Hi all, I'm looking to normalise the way in which I work with dates and times, hopefully saving myself some time and effort along the way.
Currently, for, say, a news post, i'm using a MySQL DATE column (YYYY-MM-DD), but since this isn't all that good (visually) for use on a site, I find myself converting it back out to something like DD-MM-YY or DD-MM for use on the site. Not exactly hard, but it's gotta be done every time. Now I find myself wanting to sort things by date (where the ID might be in the wrong order... so 2001-12-25 is listed before 2001-12-26, etc), and more importantly, comparing two dates (3 days away, 3 days ago, 3 hours ago, etc etc). Would I be better off using a unix timestamp for everything, then using it to: - convert to different formats - compare - sort in date order - etc etc Also, I've noticed there is a timestamp column type in MySQL... is there a way to cut down on PHP code by using MySQl alone to enter the timestamp (or date) for me? Any other suggestions on a sensible method of implementing dates & times accross many sites and many bits of code? Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]