Hi,
I am using a shared hosting which has EST US time, since i am on shared hosting that's why i cannot change the server time zone but i wanted to display local Pakistan time to my users. For example a user lists an item he/she wants to see at what time item was listed and they wanted to see it in Pakistan time not EST US time.
What's the best solution to do this? Wanted to do it on database level..
Thanks
-Mannan
MySql time problem
Moderator: General Moderators
Re: MySql time problem
You can set time zone using date_default_timezone_set() function
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
Re: MySql time problem
date_default_timezone_set()
is a php function my time is stored in mysql sir
is a php function my time is stored in mysql sir
Re: MySql time problem
You can set sql session timezone on a connection:
[sql] SET session time_zone="Asia/Karachi"; [/sql]
After that all TIMESTAMP values will be auto-converted to the specified timezone upon retrieval (date and datetime values will not be affected though).
[sql] SET session time_zone="Asia/Karachi"; [/sql]
After that all TIMESTAMP values will be auto-converted to the specified timezone upon retrieval (date and datetime values will not be affected though).