โ10-13-2023 08:52 PM
Hi Team,
I have a use case where I need to convert an epoch milliseconds String to a readable Date time format in Workato. I know that this is possible using the following Ruby method
timestamp1 = Time.at("1696731696612".to_i/1000.0).strftime("%Y-%m-%d %H:%M:%S")
However, seems like Workato does not support the Time.at method. Is there any other way which can be used here ? Also, is there a plan to whitelist this Ruby method in future ?
Solved! Go to Solution.
โ10-30-2023 05:02 AM
Hi @diparnab-dey1 ,
Here's a sample formula that you can use. You can use .to_time formula for converting an epoch value.
Output as a valid date:
โ10-30-2023 05:02 AM
Hi @diparnab-dey1 ,
Here's a sample formula that you can use. You can use .to_time formula for converting an epoch value.
Output as a valid date:
โ10-30-2023 05:27 AM - edited โ10-30-2023 05:27 AM
Thanks @marlon-muela This worked like a charm. One question though. The default time returned by this formula is in UTC or PDT ?
โ10-30-2023 05:57 AM
I believe that this is based on the account settings. You can use .in_timezone formula to convert the date/time into a specific timezone.