Solved! Go to Solution.
What is the format of your date stamp? May we please have some examples?
When you say "timestamp," are you meaning a Unix timestamp (or epoch time)? (There are others that are different. For example, SQL Server has a timestamp data type that is completely different and will not work in the same way.)
If so, Unix timestamp is the number of seconds since midnight 1/1/1970 (see http://www.convert-unix-time.com/). So, a simple formula tool containing DateTimeAdd('1970-01-01',timestamp,'seconds') will convert it to a datetime value.
I hope that helps.
If you have an integer that based on an Epoch or a Unix Timestamp, a value like 1499056140, then you can use an expression like:
DateTimeAdd("1970-01-01",[Unix Time Stamp],'second')
If you have an integer to parse like 20170703042900, then you can use an expression like:
DateTimeParse(ToString([Integer to Parse]),"%Y%m%d%H%M%S")
both would resolve to 2017-07-03 04:29:00
For the list of Specifiers to use the DateTimeParse function, see the list on https://help.alteryx.com/11.3/index.htm#Reference/DateTimeFunctions.htm
Attached is a workflow that uses each expression.
If you have a timestamp but the data type is integer you would do as follows in a formula tool (assuming ISO format):
LEFT([Value],4)+'-'+RIGHT((LEFT([Value],6)),2)+'-'+RIGHT((LEFT([Value],8)),2)+' '+RIGHT((LEFT([Value],10)),2)+':'+RIGHT((LEFT([Value],12)),2)+':'+RIGHT((LEFT([Value],14)),2)
An example would be 20170703142800 to 2017-07-03 14:28:00
Then adjust your formula output field type to be DateTime.
Tks Joe!