Influxdb data into a csv file

I have downloaded the database data into csv file by using following command

influx -database ‘database_name’ -execute ‘SELECT * FROM table_name’ -format csv > test.csv

It worked fine for me, but unfortunately timestamp has not the proper format to be read the corect time and date.

How can i get the proper time stamp?

Thank you

Hello @asif ,
Hello you can use any language you want to convert from unix timestamp to ISO 8601.
Here’s a python example:

import pytz
from datetime import datetime

tz = pytz.timezone('America/Los_Angeles')
print(datetime.fromtimestamp(1463288494, tz).isoformat())

Hello @asif ,
Here’s a stack overflow for google sheets too

How did you make it work @asif I tried a couple of times but to no avail. The following is the command I used:

influx -database ‘chirpstack’ -execute ‘SELECT * FROM device_frmpayload_data_BC’ -format csv > test.csv

It throws the following error:
ERR: error parsing query: found influx, expected SELECT, DELETE, SHOW, CREATE, DROP, EXPLAIN, GRANT, REVOKE, ALTER, SET, KILL at line 1, char 1

How do I fix the error? Also I’d like to know if there’s a way by which I can export the database in one go, instead of exporting one measurement/table one at a time? Many thanks in advance.