Date time showing as 1970

Hi, iam converting a datetime value via powershell and writing this to influxdb. When it comes to viewing the data in the table panel, it displays the date as ‘1970-01-18 19:58:05’ when i change the column type to date. My date time conversion in powershell is done by this line (Get-Date -Date $_.created -UFormat %s) which writes a value of 1493885235 to the db.

I didnt think a nanosecond resolution was required but please advise.


The default precision for dates in InfluxDB is nanoseconds. From the line protocol docs:

InfluxDB uses the server’s local nanosecond timestamp in UTC if the timestamp is not included with the point.
Unix nanosecond timestamp. Specify alternative precisions with the HTTP API.

You can specify a different precision when writing to InfluxDB via the API using the precision parameter:


There is also an example there of writing data with second precision:

$ curl -i -XPOST "http://localhost:8086/write?db=mydb&precision=s" --data-binary 'mymeas,mytag=1 myfield=90 1463683075'