Select from mysql by day with different timezones (php)

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2010-03-20T10:35:33Z Indexed on 2010/03/20 10:41 UTC
Read the original article Hit count: 382

Filed under:
|
|
|

I'm storing leads in a database, and each lead has a datetime field with a PST timezone based date & time.

I want my user to be able to display all leads from a certain date (e.g. today, yseterday), and choose the timezone.

E.g. if I want to see all leads that were generated yesterday in EST timezone, I need to first convert (or read) all the datetime values to EST, and then only select those who are in the right range (yesterday).

What would be the best way to do that?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about timezone