Welcome Guest, Not a member yet? Register   Sign In
How to get entries from DB depending on timezone?
#13

[eluser]WanWizard[/eluser]
Unfortunately, dealing with timezones is a lot more complicated than this.

DST rules change on a regular basis. To be able to convert a date/time input on a form by a user, you need to know to which timezone that date/time belongs. You then have to figure out the DST settings for that date/time given the timezone. Now you can convert it correctly to GMT. When you want to display it, you need to know the timezone in which to display it, and the DST settings in that timezone for the given date/time. Now you can convert the stored GMT timestamp to the proper 'local' value.

Check this http://derickrethans.nl/storing-date-tim...abase.html from the author of PHP's new DateTime class...


Messages In This Thread
How to get entries from DB depending on timezone? - by El Forum - 04-10-2010, 06:35 AM
How to get entries from DB depending on timezone? - by El Forum - 04-10-2010, 07:26 AM
How to get entries from DB depending on timezone? - by El Forum - 04-10-2010, 11:01 AM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 12:24 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 02:49 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 02:53 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 02:58 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 03:28 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 03:53 PM
How to get entries from DB depending on timezone? - by El Forum - 04-12-2010, 04:12 PM
How to get entries from DB depending on timezone? - by El Forum - 04-15-2010, 10:20 AM
How to get entries from DB depending on timezone? - by El Forum - 04-15-2010, 11:39 AM
How to get entries from DB depending on timezone? - by El Forum - 04-15-2010, 11:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB