I have stored a time in my database, for example this data: 2014-03-25 13:15:00
But when I use UNIX_TIMESTAMP(date_field) through mysql query or strtotime() in PHP, both functions output is effected by timezone.
Please tell me if it's possible to get unix time without timezone effect? It will also be very helpful if anyone can provide a PHP function.
Please do not suggest to me to change the timezone, because this is not a suitable solution.
Current output of 2014-03-25 14:05:00 when covert to unix and then again convert to date 2014-03-25 08:35:00
UPDATE
this not only happen only to DB time. like if I directly call this :
date('Y-m-d H:i:s', strtotime(2014-03-25 14:05:00))
then it output
2014-03-25 08:35:00
UNIX_TIMESTAMP(timestamp_type_column)will not perform any timezone conversion whatsoever, asTIMESTAMPtype columns are already stored in UTC. However, storing literal'2014-03-25 13:15:00'into aTIMESTAMPtype column must therefore convert from the session'stime_zoneto UTC, which is presumably the effect to which your question refers. But how could one expect otherwise?