Hi all,
i hope this is a really simple answer to my question as i have been trying to find one for the past few hours.
i'm trying to convert a timestamp from UTC into the users relevent timezone.
Currently i save all timestamp to the database as UTC and when i pull them out i need them changing. the user has a timezone assigned to their record e.g 'Europe/London'
i need in PHP to say UTC is the current timezone for this timestamp, now change it to timezone 'Europe/London' or any other.
Has anyone got any ideas?
p.s i have looked into the CONVERT_TZ in mysql but the timezone table isn't setup on the server and i can't access it.
Changing Timezone
Moderator: General Moderators
Re: Changing Timezone
Raw timestamps don't have a timezone. They're UTC or just plain numbers.
So what are you storing? DATE? UNIX_TIMESTAMP? time()?
I store numbers - what MySQL's UNIX_TIMESTAMP and PHP's time give. Then with PHP 5 I use date_default_timezone_set to set a timezone and date to convert the number into a string - the timezone is handled automatically.
So more details, if you please.
So what are you storing? DATE? UNIX_TIMESTAMP? time()?
I store numbers - what MySQL's UNIX_TIMESTAMP and PHP's time give. Then with PHP 5 I use date_default_timezone_set to set a timezone and date to convert the number into a string - the timezone is handled automatically.
So more details, if you please.