You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve been using “2017-03-14 00:00:00” format for a long time, Im not entirely sure why TBH, perhaps because it contains everything you need in a condensed format?
I usually convert Unix time stamp to this format with:
$datestr = date("Y-m-d H:i:s",time());
luckily php’s strtotime converts a large variety of time formats back to unix time :slight_smile: I dont really have a strong opinion on this either way
The text was updated successfully, but these errors were encountered:
The problem, as seen, is that this is ambiguous in that there is no indication of the timezone and could easily be interpreted as local time by an external processor (which in the absence of a timezone many will do). If the data was fed back in, would strtotime assume it was local rather than UTC? Just tested it and strtotime doesn't actually like this format.
I'd prefer:
$datestr = date(DATE_ISO8601);
Or even make the format user configurable 😄 That would of course help anyone who wants it in the current format.
In the forum thread https://community.openenergymonitor.org/t/timestamp-issue-when-importing-csv-exported-data-from-emoncms-org-feeds-list/7863/19 we discussed time stamp formats for the CSV output in the graphs module.
Do we need to amend the available output format?
The output format is defined here https://github.com/emoncms/graph/blob/master/graph.js#L837
I’ve been using “2017-03-14 00:00:00” format for a long time, Im not entirely sure why TBH, perhaps because it contains everything you need in a condensed format?
I usually convert Unix time stamp to this format with:
$datestr = date("Y-m-d H:i:s",time());
luckily php’s strtotime converts a large variety of time formats back to unix time :slight_smile: I dont really have a strong opinion on this either way
The text was updated successfully, but these errors were encountered: