Skip to content

CSV time output format #23

Open
Open

Description

@TrystanLea

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

Activity

  1. borpin commented on Jul 17, 2018

    @borpin

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions