# Reformatting the CSV Data

**URL:** <https://community.influxdata.com/t/reformatting-the-csv-data/25279>\
**Category:** Systems\
**Created:** [June 3, 2022, 1:22am UTC](https://community.influxdata.com/t/reformatting-the-csv-data/25279 "2022-06-03T01:22:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![subwayfootlong](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/subwayfootlong/32/7263_2.png) [@subwayfootlong](https://community.influxdata.com/u/subwayfootlong)\
**Post date:** [June 3, 2022, 1:22am UTC](https://community.influxdata.com/t/reformatting-the-csv-data/25279/1 "2022-06-03T01:22:13Z")

</div>

Hello all,  
Im using influxdbv2 and exporting data seems to be a challenge with the CSV.

Number 1:  
Right now the data is being downloaded to csv in UTC. Is there a way for me to download in a different time zone? E.g UTC to SGT

Number 2:  
The CSV file is written like this:

| table | \_start | \_stop | \_time | \_value | \_field | \_measurement | |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | 2022-06-03T01:11:25.7168602Z | 2022-06-03T01:12:25.7168602Z | 2022-06-03T01:11:30Z | 49.33333333 | humidity | Sensor 4 | |
| 1 | 2022-06-03T01:11:25.7168602Z | 2022-06-03T01:12:25.7168602Z | 2022-06-03T01:11:30Z | 26.81333333 | temperature | Sensor 4 | |

Is there a way to change it to:

| \_start | \_stop | \_time | humidity | temperature | \_measurement |
| --- | --- | --- | --- | --- | --- |
| 2022-06-03T01:11:25.7168602Z | 2022-06-03T01:12:25.7168602Z | 2022-06-03T01:11:30Z | 49.33333333 | 26.81333333 | Sensor 4 |

Or something similar for ease of use?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [June 10, 2022, 7:59pm UTC](https://community.influxdata.com/t/reformatting-the-csv-data/25279/2 "2022-06-10T19:59:22Z")

</div>

Hello @subwayfootlong,

I’m confused are you writing an annotated csv or a regular csv?  
How are you getting the annotated csv?  
And how are you trying to write the csv?

If you’re using flux to write the annotated csv you can use:

- the timezone package: [timezone package | Flux 0.x Documentation](https://docs.influxdata.com/flux/v0.x/stdlib/timezone/)
- the timeshift function: [timeShift() function | Flux 0.x Documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/timeshift/)

As an aside  
You can use the python client library to write a dataframe to InflxuDB and change the timezone:

> <https://github.com/influxdata/influxdb-client-python/issues/438>
>
> Currently users have to do a bit of timestamp manipulation in order to write pan…das DataFrames, for example:
> !\[image\](https://user-images.githubusercontent.com/30506042/168647474-e84ccf9a-013b-426a-a2ee-f4a416af622e.png)
> 
> The following features could make working pandas DataFrames easier:
> \- The ability to specify the timestamp column/not set the timestamp column as an index 
> \- The ability to specify the timestamp type and automatic conversation (like from ISO or rfc3339 timestamps to datetime objects).

Here’s how you can convert csv to a dataframe  
[https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to\_csv.html](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html)

---

<div class="post-metadata">

**Author:** ![kushan-26](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/kushan-26/32/15003_2.png) [@kushan-26](https://community.influxdata.com/u/kushan-26)\
**Post date:** [January 29, 2024, 6:00pm UTC](https://community.influxdata.com/t/reformatting-the-csv-data/25279/3 "2024-01-29T18:00:46Z")

</div>

Hello,

Was there any updates on exporting data to the format requested by the author of this question?
