Date Conversions problem !!
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Date Time
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
