php/mysql & dates

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

php/mysql & dates

Post by m3rajk »

not sure if it should be here or in databases...

i wanna store joining date and last login in a way that i cna manipulate easily to show as the user's time. i store gmt offsetin hours in the db already.

i know time() returns the gmt timestamp (without daylight savings)
iknow how to do the calculations WITHOUT taking daylight savings into account

as far as i know the only mysql function (NOW()) does the time for the system. i'd prefer to store UTC/GMT time...easier to manipulate to a user's timezone.

i'm wondering what others have done ansd what tey recommend. learning from your experiences will help me avoid mistakes. ...escpecially since there is a planned expansion to create a forums from scratch, including a timestamp on when the post was made, and when it was last edited.
Post Reply