Page 1 of 1
Get Hour ?
Posted: Fri Apr 29, 2005 4:32 pm
by Death
Hi guys,
I need the current hour in [0,23] format, the local server time is just fine. What's the best (fastest) way to get this value ?
Thanks.
Posted: Fri Apr 29, 2005 4:33 pm
by Ambush Commander
Why don't you try benchmarking it yourself? Don't take our word for it: do it!
Posted: Fri Apr 29, 2005 4:39 pm
by hawleyjr
check out the date function in PHP
Posted: Fri Apr 29, 2005 4:47 pm
by Death
I don't know how to benchmark PHP, that's why.
When I benchmark C++ I run a Performance Counter so it's pretty straightforward.
Also, I develop my PHP on a WinXP machine then upload it to my web server so it's not so easy to benchmark.
Anyway, I'm going to do it this way for now:
Code: Select all
$hour=date("H");
settype($hour,"integer");
Take care.