View Full Version : Mysql Date & Time with Timezone

10-29-2007, 11:09 AM
PHP 4.4 - MySQL 4.1

My clients are access my application from deferent timezone. I've stored my clients Timezone in a Table.
When one access my page I have to store his access Date & Time in my database.
When he or I will see his access information my application has to show date & time as his/my local timezone.

I'm very much confused about the date & time in PHP+mysql.
Now how can I store the GMT Date & time ?

Please Help.

10-29-2007, 01:21 PM
Can i set Timestamp ? or anyother?
What i have to use time(), NOW() or any other?
Which way

10-29-2007, 04:17 PM
gmdate() (http://php.net/gmdate). You should also look into date_default_timezone_set() (http://php.net/date_default_timezone_set) and the whole Date/Time function list (http://php.net/datetime).