Hi all,

I'm looking for a clear, dependable way to work with dates in a web application.

There are two types of dates that I can see I'll need:

a) a timestamp for 'now' generated by the server (eg used on a last updated field)
b) a timestamp for a user-specified date, like 2003-11-28 13:45:59


I'd like to take into consideration that dates (content) may be added on a staging server in a different timezone, then copied to the live server, but need to appear as entered/generated. In other words, 2003-12-28 13:45:02 is always exactly that.

I'd also like to take into consideration that the website may choose to display all dates with an offset from GMT, and that users may choose to do the same.

So far I've been looking purely at PHP with unix timestamps to be stored in either files or mysql, but perhaps I need to consider storing in other formats (like YYYY-MM-DD HH:MM:SS)


I've been going around in circles on this for a few hours, so if anyone can provide advice on how i should stamp items (eg 'last updated'), how I should generate dates from user input (eg an event date), and how i should retrieve and convert these to human readable dates, keeping in mind that these dates will be generated in multiple timezones would be great. Links to articles would also be great.


On top of that, site-wide and user-preference time offsets from GMT would be a lovely addition to the above requirements :)

On top of that, auto-detection of daylight savings time of the site-wide or user-preference offset would be brilliant :)


Thanks, Justin

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to