Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Objects - Using a date

Status
Not open for further replies.

dru312

Programmer
Nov 20, 2002
11
0
0
US
I have attached my code below. I need to know how I would change this to store the current date instead of the entry # into the sol.... can someone help me?? Thanks.
__________

myJournal = SharedObject.getLocal("JournalObject", "/" );
if (myJournal.data.journal == undefined) {
myJournal.data.journal = [];
}
function displayEntry(num) {
_root.entryNumber.text = num;
_root.journalBody.text = myJournal.data.journal[num -1];
}
displayEntry(myJournal.data.journal.length);
function save(){
var num = Number(_root.entryNumber.text) -1;
myJournal.data.journal[num] = _root.journalBody.text;
myJournal.data.flush();
}
function newEntry() {
_root.entryNumber.text = myJournal.data.journal.length +1;
_root.journalBody.text = undefined;
Selection.setFocus("_root.journalBody");
}
function nextEntry (){
var num = Number(_root.entryNumber.text) +1;
if (num > myJournal.data.journal.length) {
num = myJournal.data.journal.length;
}
displayEntry(num);
}
function previousEntry(){
var num = Number(_root.entryNumber.text) -1;
if (num <1) {
num = 1;
}
displayEntry(num);
}
 
RightNow = new Date();

just refer to RightNow to insert the date
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top