Low Events Timestamp Not Converting to UTC
I'm trying to use moment.js to update an event's time based the timezone the user selects in a dropdown. To do this, I'm using Low Events' :start_stamp
tag to output the unix timestamp as a data attribute that moment.js can use to manipulate the time.
Here's what I'm confused about:
My server's timezone is "America/Los_Angeles". I published an entry with a Low Events start time of 10:00 AM. So Low Events assumes I mean 10:00 AM Pacific Time.
But when I use the :start_stamp
tag, the timestamp outputs 10:00 UTC, where it should be outputting 15:00 UTC.
I could be wrong about how unix timestamps work, but I thought they were always in UTC...?
EE 2.7.2
Low Events 1.2.0
Replies
Low 7 Apr 2014 20:44
No, Unix timestamps are not necessarily stored in UTC. In LE's case, the date/time itself is stored as a MySQL date/time field. No timezone info is stored at all. So if you output the timestamp using :start_stamp, then LE simply takes the date/time given, and passes it to PHP's strtotime function, which returns a timestamp. Nowhere in this process is the time converted to any other timezone -- everything happens using the server default. Make sense?
kgrote 8 Apr 2014 17:10
Ah, ok. That's the source of my issue then. Thanks!