Hey,
I need to convert a date time field to this format: 2016-12-28T16:03:06.000Z in a table.
How can I do this in Coda?
Thanks!
Hey,
I need to convert a date time field to this format: 2016-12-28T16:03:06.000Z in a table.
How can I do this in Coda?
Thanks!
Honestly — there’s no way to do exactly this without a pack.
Reason: as the letter Z shows in the end, this is the time after converting it to the UTC time zone. And in Coda unfortunately there is no way to programmatically convert times between timezones. You can add and subtract offset hours but that will not take DST transitions into account. Even if your webhook permitted specifying arbitrary timezone (i.e. in 2016-12-28T16:03:06.000-0800
format) there’s no way to calculate what exactly offset applied at that moment (e.g. was it UTC-8 or UTC-7 in Pacific Time for that date)
How are you going to send this webhook anyway? If you’re going to do it through a custom pack, just implement the conversion within the pack. If you’re going to read these values from your Coda table and use as is elsewhere, the best you can do is turn this into the unix timestamp with DateToEpoch()
and pass over the number of seconds that uniquely identifies a moment in time regardless of the time zone. Then, on the receiving or middleware side convert that to ISO date if needed.
Thanks,
Yes I discovered the DateToEpoch which works, I can then covert elsewhere.
I’m now using the BoostGenius Make Utilities to send my data to Make.com, and then using a combination of Make.com and Power Automate to get my desired results.
Ideally I’d like to send a webhook directly to Power Automate, which I’m sure I could hack using the Open URL button (I might do this later, still testing) but I’d really like to use a Power Automate webhook directly in the same way packs have been built for Make.com. Also a potential future project! Wish I had more hours in the day!
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.