Quote:
Originally Posted by Jacapo
Hello,
I have a litte question about gettime function.
Код:
new hour, minute, second;
gettime(hour, minute, second);
if(hour >= 03)
{
//some code
}
So simply i want: hour 03 AM (morning), but in script it is wrong
|
//EDIT:misunderstood something.
so, where's your problem?
you have what you want, if hours equals 3 (or greater than 3), it's 3am in the morning.
you can just do your stuff in that control structure.
btw. if you were to put some code generating some message like "hello! it's 3 am!"
with the current condition in that control structure, it would still say that it's3 am in the morning even if it's 9 pm :P
something like
would be better for things like that.
ah, well, you could also do a nice switch, if you want multiple messages displaying at certain times of the day