Timestamp code in powerchart exported csv file

In the newest version of the powerchart in perspective, I export the chart to a csv, but the timestamp isn’t in a format that I know what to do with in excel, I’ve tried all the default formats and they don’t seem to work.
This is what I get in the time column:
1605200791937

What is this timestamp format?

It’s a modified Unix epoch timestamp, the standard Java internal representation of timestamps. Unix timestamps are defined as seconds since Jan 1 1970; Java timestamps are milliseconds since Jan 1 1970.

Excel doesn’t have a way to convert these with a single formula, apparently, but it’s not too complicated:

You will want to divide the timestamp by 1000 (if you don’t care about losing the millisecond precision) before using the formula in the above link.

Awesome, thanks for your help!

Just as a follow-up… As part of the 8.1.2 release, we added config.export.dateFormat and config.export.timeFormat component properties that will give you better control over the format of the timestamp. It can now be a millisecond timestamp or something more human-readable.

1 Like

Fantastic, luckily I didn’t implement and train for the old workaround yet, thanks for the feature!

I just had a look at this, it seems that the date format does not accept all placeholders as system.date.format allows. In particular, it doesn’t allow yyyy, only YYYY, does this mean it is using the week based year?

Those are separate date format implementations. For the formatting of the date here, you’ll want to check out MomentJS for all of the formatting options available to you if none of the provided options are what you need. You can enter whatever custom format is necessary, and it will be used.