MySql from unix time gives 1 hour too much -
small question bothering me while now. i'm creating query gets data mysql database. in data 1 field time , saved unix time in case lets 7500
value.
7500
converted 02:05
in time, when query database result 03:05
. have checked time zone of server, mysql server , computer , there same.
my query:
select timebilled `ticket_time`, from_unixtime(timebilled, '%h:%i') `ticket_time_parsed` data_table
so how fix this?
edit:
i solved problem changing time on windows server 2012 uct+1 utc. value 7500 02:05 me. help.
whatever use convert 02:05
7500
not respecting timezone should. 7500
02:05
in utc, in utc+1. 02:05
should converted 3900
.
but if storing time of day , don’t want timezone conversions, stay away unixtime , store seconds till 00:00
, convert myself.
Comments
Post a Comment