Pages: 12

  2008-08-02 21:43:23

sherwin017
» n00b
FTalk Level: zero
16
0
1969-12-31

[quote]this code will alert the viewer [b]good morning[/b] if the time on your computer is 12:00 below, [b]good afternoon[/b] if 12:00 am above and 6:00 pm below and [b]good night[/b] if 6:00 pm above

var ThisDate = new Date(); var ThisTime = ThisDate.getTime(); function greet() { ThisDate.setTime(ThisTime); var ThisHour = ThisDate.getHours(); if (ThisHour > 17) display = "Evening"; else if (ThisHour >12) display = "Afternoon"; else display = "Morning"; alert("Good " + display + "... Welcome to "+pageOwnerFName+" Page...") } greet();

Pages: 12

Board footer

© 2025 F Talk

Current time is 11:17

[ 12 queries - 0.007 second ]
Privacy Policy