Results 1 to 2 of 2
May 11, 2012, 23:52 #1
- Join Date
- Apr 2012
- 0 Post(s)
- 0 Thread(s)
How to get today's date when it is not the server date?
My site sits on a server in the US but the members are mainly from New Zealand. There is a 16 hour time difference.
I am playing with a "Members Online Today" script.
I can get the members online today but it relates to the server time, so at 4pm our New Zealand time there is suddenly 0 members online today as it resets itself when the server clocks over past midnight.
One column in the table is called user_lastvisit - it is an int(10) - it stores the date and time as a timestamp
This is the code that I have at the mo
WHERE user_lastvisit > UNIX_TIMESTAMP(CURDATE())
Any ideas or suggestions would be great or even not using UNIX_TIMESTAMP(CURDATE() and something completely different. I have just released I also need to allow for daylight saving ....
Thank you for your time
May 12, 2012, 05:43 #2
Also need to set the timezone for PHP
http://dk2.php.net/manual/en/functio...mezone-set.phpLogic without the fatal effects.
All code snippets are licensed under WTFPL.