开发者

How to store the timezone?

开发者 https://www.devze.com 2022-12-10 12:39 出处:网络
Hi i am using PHP to store the timezone.The timezone coming from dropdown and when I try to store it if its (GMT+5.30) or (GMT+anything) the plu开发者_如何学编程s symbol doesnt stored on database.It *

Hi i am using PHP to store the timezone.The timezone coming from dropdown and when I try to store it if its (GMT+5.30) or (GMT+anything) the plu开发者_如何学编程s symbol doesnt stored on database.It **stored as (GMT 5.30).**How can I store it correctly?


Store all your times in UTC, that way you can easily convert them to any timezone that you require.

As for the timezone - I would store this in a seperate column either with the offset from UTC or even better store the locale of the timezone e.g. "America/New_York" that way you can accomodate for daylight saving times also.


$url_safe = urlencode($string);

0

精彩评论

暂无评论...
验证码 换一张
取 消