Reputation: 71
I set the month, day and year like this:
$mm = date("m");
$yy = date("Y");
$day = date("d");
And then in a mysql query I select based on $day.
How do I deal with time zones? If someone in california runs this at 11pm their time it will be incorrect (my server is EST).
I tried to use offset but this changed the whole day ahead. This does not work
$offest = '+1';
$day = date('d', strtotime($offset));
That just changes the date regardless of time.
I do have the fields stored as datetime.
Upvotes: 0
Views: 32
Reputation: 81
use function time() example:
time()+3600(1 hours)
$date = date('d',time);
Upvotes: 1