# Timestamp code in Power Chart exported CSV file

**URL:** <https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [November 13, 2020, 5:23pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643 "2020-11-13T17:23:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![toughautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/toughautomation/32/27171_2.png) [@toughautomation](https://forum.inductiveautomation.com/u/toughautomation)\
**Post date:** [November 13, 2020, 5:23pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/1 "2020-11-13T17:23:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 13, 2020, 5:35pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/2 "2020-11-13T17:35:38Z")

</div>

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:

> **[Excel formula: Convert Unix time stamp to Excel date | Exceljet](https://exceljet.net/formula/convert-unix-time-stamp-to-excel-date)**
>
> The Unix time stamp tracks time as a running count of seconds. The count begins at the "Unix Epoch" on January 1st, 1970, so a Unix time stamp is simply the total seconds between any given date and

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.

---

<div class="post-metadata">

**Author:** ![toughautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/toughautomation/32/27171_2.png) [@toughautomation](https://forum.inductiveautomation.com/u/toughautomation)\
**Post date:** [November 13, 2020, 6:01pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/3 "2020-11-13T18:01:20Z")

</div>

Awesome, thanks for your help!

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [January 27, 2021, 9:11pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/4 "2021-01-27T21:11:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![toughautomation](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/toughautomation/32/27171_2.png) [@toughautomation](https://forum.inductiveautomation.com/u/toughautomation)\
**Post date:** [January 28, 2021, 9:52pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/5 "2021-01-28T21:52:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![michael2](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@michael2](https://forum.inductiveautomation.com/u/michael2)\
**Post date:** [August 11, 2021, 12:14am UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/6 "2021-08-11T00:14:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [August 11, 2021, 5:21pm UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/7 "2021-08-11T17:21:28Z")

</div>

Those are separate date format implementations. For the formatting of the date here, you’ll want to check out [MomentJS](https://momentjs.com/) 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.

---

<div class="post-metadata">

**Author:** ![luisdavidof](https://avatars.discourse-cdn.com/v4/letter/l/439d5e/32.png) [@luisdavidof](https://forum.inductiveautomation.com/u/luisdavidof)\
**Post date:** [April 5, 2024, 3:24am UTC](https://forum.inductiveautomation.com/t/timestamp-code-in-power-chart-exported-csv-file/40643/9 "2024-04-05T03:24:23Z")

</div>

Thanks for that clarification of the time.  
In that same CSV, percentage values appear with different numbers. I imagine they have some very small scale that I cannot decipher like this: 10029121651553000.  
Which corresponds to a value very close to 1% according to my measurements, what is the parameterization for this case?

Gracias por esa aclaración del tiempo.  
en ese mismo CSV me aparecen valores de porcentaje con números diferentes, imagino que tienen alguna escala muy pequeña que no logro descifrar así: 10029121651553000.  
Que corresponde a un valor muy cercano al 1% según mis mediciones, cual es la parametrización para este caso?
