Re: Re: I18Nv2 and internationalization
| From: | Dan Rossi | Date: | Wed, 09 Nov 2005 11:36:48 +0000 |
| Subject: | Re: Re: I18Nv2 and internationalization | ||
| References: | 1 2 3 4 5 6 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21855@lists.php.net to get a copy of this message | ||
On 09/11/2005, at 10:26 PM, Michael Wallner wrote:
Sorry to bug you again.
TZ for this server would be east coast US as in Florida.Short answer: Store the local time of your server in the database. Long answer: Imagine your servers TZ is CET, and someone
from NYC wants to add a schedule. You'd need to know the users timezone so she can enter a localized date. This cannot be guessed/negotiated so you need to ask her.Can you not get their timezone by using a mixture of GeoIP and this package ? Will giving them a country drop down not be enough ? which i can then use the country code to get a timezone / locale ?
Then convert the date from the users timezone to CET to store it in the db.Umm, its something I havent had to do before, if its in Mysql itself just say and ill google it up.
When you're going to display the schedules fetch the dates with UNIX_TIMESTAMP() (or equivalents) and display it with I18Nv2. Yeah, it's not that easy as you might have thought in the first place, but there may be more straight forward solutions I didn't recall yet... :)Well the display part is not a problem, its the converting and inserting of the date which is an issue :|