Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Date Conversions problem !!

Nagarjunrao24
5 - Atom

Hi all , 

 

I am very new to alteryx. I am trying to convert an unix  time stamp(Publishing date JavaScript equivalent of a DateTime
how many milliseconds have passed between now and the beginning of 1970: for example:1474315762000) to date in alteryx. I am getting all the data in from an API in json format and parsing it as string. 

 

I need solution for 

 

how to convert from unix time(data type :string) to date in alteryx! (FYI i tried datetimeadd, and did not work properly) 

 

Any help would be appreciated 

 

regards

Nagarjuin Srinivas 

 

3 REPLIES 3
jdunkerley79
ACE Emeritus
ACE Emeritus

Probably the easiest way it is to use a select tool to convert to an Int64.

 

You can then use a formula tool to convert to a datetime by adding seconds to 1970-01-01:

DateTimeAdd('1970-01-01',Field1/1000, 'Seconds')

Alteryx only stores dates to the nearest second so you need to keep that as a separate column.

 

Sample attached.

Nagarjunrao24
5 - Atom

Thank you for the solution. it worked 

 

regards

Nagarjun Srinivas 

AKPWZ
8 - Asteroid

Hi @jdunkerley79 I have one query related to unix/epoch time conversion.

I'm using this formula to convert this unix/epoch time into normal date time format but it throwing an error - 

Error - "Error: Formula (23): Parse Error at char(38): Formula: tried to apply numeric operator to string value (Expression #1)
"

Formula: DateTimeAdd('1970-01-01',[created_at]/1000, 'Seconds')

 

Can you please help me what wrong I'm doing here?

Thank you

Labels