I was searching google for a "workato example formula with text lead in and timestamp converted from milliseconds". an old, but deprecated post showed up (see image). i.e. update a log to "First seen at <timestamp.shortDateTime>\n last seen at <timestamp 2>" but the timestamp is coming in milliseconds. My question appears to have been answered in the old community. Have the posts been reloaded here? or can someone help answer the question directly?
An epoch timestamp is the number of seconds that it has been since 1970-01-01. You can create an epoch timestamp using a datetime datapill or formula and the .to_i function. =now.to_i You can convert an epoch timestamp back to a string datetime value by adding the number of seconds to 1970-01-01. ='1970-01-01'.to_time + now.to_i.seconds ='1970-01-01'.to_time + {epoch value datapill}.seconds For an epoch timestamp in milliseconds, you can divide by 1000 first before adding the result as seconds.
the docs say that the epoch value datapill must be of type timestamp, but the data pill is coming in as an integer, i.e. 1788987018779. I get an error try to .to_time that integer, so I can't make the conversion that way. how do I use that integer datapill for epoch time given the docs say it must be a datetime pill?
Itβs possible the value 1788987018779 is still being interpreted as a string despite looking like an integer. If you run now.to_i.to_time it returns: 2026-09-10T15:01:13.000000-07:00 So itβs possible you simply need to add .to_i to your formula to re-type it before .to_time Images attached. Hope this helps!
