KNOWLEDGE BASE

Dates Display in Unix Time Instead of Date or Datetime


Published: 02 May 2013
Last Modified Date: 09 Jan 2020

Issue

A datetime field is displayed as a number or string in Tableau.

Environment

Tableau Desktop

Resolution

To convert the field to UTC time, use the following calculation:

DATEADD('second', [Unix time field], #1970-01-01#)


To convert the field in Unix time to a different time zone, use the following calculation:

DATEADD('minute', INT([Unix time field]/60 + <UTC offset in minutes>), #1970-01-01#)


For example, to convert the field in Unix time to India Standard Time (IST), use the following calculation:

DATEADD('minute', INT([Unix time field]/60 + 330), #1970-01-01#)


Note: Both the above options assume that the Unix time field is in seconds. If the field is in milliseconds, convert it by dividing the field by 1000.

Cause

The datetime field uses the Unix time format. Tableau Desktop does not automatically convert this time format into a date or datetime format.
Did this article resolve the issue?