...

View Full Version : Script help !!



waps
07-08-2002, 07:22 PM
Hi everyone,

I got this bit in my script which is suppose to determine what the time of day is and set a variable to a certain message. The script is suppose to do the following:
1. If the time is between 12am and 12pm the message should be 'Good Morning'
2. If the time is between 12pm and 5pm the message should be 'Good Afternoon'
3. If the time is between 5pm and midnight the message should be 'Good Evening'

Except I can't seem to get it working like this, can you take a look at this piece of script and see why it isn't working 100%

Thanks in advance :thumbsup:

if (now.getHours() > 0) {
Mes = "Good Morning"
}
else if (now.getHours < 12) {
Mes = "Good Morning"
}
else if (now.getHours() < 17) {
Mes = "Good Afternoon"
}
else if (now.getHours() < 24) {
Mes ="Good Evening"
}

tamienne
07-08-2002, 07:55 PM
if ((now.getHours()) > 0 && (now.getHours() < 12)) {
Mes = "Good Morning"
} else if ((now.getHours() >=12) && (now.getHours() < 17)) {
Mes = "Good Afternoon"
} else if (now.getHours() >= 17) {
Mes ="Good Evening"
}

waps
07-08-2002, 08:06 PM
Thanks tamienne

Thanks very much !!! Works perfectly !!!

:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum