# Timestamp convert format of a csv file

**URL:** <https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488>\
**Category:** Systems\
**Created:** [June 11, 2018, 1:34pm UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488 "2018-06-11T13:34:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilmiomondo](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@ilmiomondo](https://community.influxdata.com/u/ilmiomondo)\
**Post date:** [June 11, 2018, 1:34pm UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488/1 "2018-06-11T13:34:48Z")

</div>

i have this code , to download datas from a valve in command window  
Example:  
influx -database fielddata -host [xyxy.com](http://xyxy.com) -port xyxy -execute “select \* from zones WHERE (valve = ‘101’) AND time \> ‘2018-03-23’ and time \< ‘2018-04-23T23:59:59Z’” -format csv \> test.csv

the problem is that get timestamps like that: time:1521763242000000000  
i have no clue how i can convert it…i need help:-(  
i would like to have this format: 2015-07-17T20:32:58  
i have read something about " precision rfc3339" but i have no clue where i have to put in the code above.  
Thank you for your help.

---

<div class="post-metadata">

**Author:** ![katy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/katy/32/855_2.png) [@katy](https://community.influxdata.com/u/katy)\
**Post date:** [June 12, 2018, 9:12pm UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488/2 "2018-06-12T21:12:02Z")

</div>

In the code above, you should be able to add `-precision rfc3339` to get the format you want.

---

<div class="post-metadata">

**Author:** ![ilmiomondo](https://avatars.discourse-cdn.com/v4/letter/i/b5a626/32.png) [@ilmiomondo](https://community.influxdata.com/u/ilmiomondo)\
**Post date:** [June 13, 2018, 6:45am UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488/3 "2018-06-13T06:45:32Z")

</div>

Hey Katy thank you, it works!  
Hey influx --precision rfc3339 -database fielddata -host [xyxy.com](http://xyxy.com) -port xyxy -execute “select \* from zones WHERE (valve = ‘101’) AND time \> ‘2018-03-23’ and time \< ‘2018-04-23T23:59:59Z’” -format csv \> test.csv  
i have another question:  
what kind of meaning has the letter Z for the time (2018-04-23T23:59:59 **Z** )?

---

<div class="post-metadata">

**Author:** ![noahcrowley](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/noahcrowley/32/818_2.png) [@noahcrowley](https://community.influxdata.com/u/noahcrowley)\
**Post date:** [June 13, 2018, 10:28am UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488/4 "2018-06-13T10:28:27Z")

</div>

You’re using [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. RFCs document various technologies used to make the internet work, and can be found through a quick web search.

In this case, here is the relevant definition from the RFC:

```plaintext
      Z A suffix which, when applied to a time, denotes a UTC
                  offset of 00:00; often spoken "Zulu" from the ICAO
                  phonetic alphabet representation of the letter "Z".

```

---

<div class="post-metadata">

**Author:** ![katy](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/katy/32/855_2.png) [@katy](https://community.influxdata.com/u/katy)\
**Post date:** [June 13, 2018, 6:24pm UTC](https://community.influxdata.com/t/timestamp-convert-format-of-a-csv-file/5488/5 "2018-06-13T18:24:33Z")

</div>

@ilmiomondo The Z is just part of the formatting. It’s common when timestamps get returned in JSON, as well as some other formats.
