How to generate begin and end dates in UTC?
- 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,
I am planning to call a survey monkey restful API to collect the data, But the API accepts the date arguments in the following UTC format.
YYYY-MM-DDTHH:MM:SS+HH:MM
As I want to schedule this API every day, I wan to generate current day begin and end dates in the above format.
I have created 2018-08-29 00:00:00 and 2018-08-29 23:59:59 dates and called DateTimeToUTC(dt) on these begin and end dates. But the result format is not as above.
Any ideas on how to generate dates in the above format?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Maybe this is a crude solution, but could you just build the "YYYY-MM-DD HH:MM:SS" string with the DateTime functions, then convert to a string and replace the space with a "T"?
Alteryx Formula:
replace(tostring(DateTimeFormat(DateTimeToday(),"%Y-%m-%d %T")),' ','T')
Result:
2018-08-29T00:00:00
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I think @CharlieS is probably on to something.
I assumed that you wanted to calculate the TZD and use that in the final output. That involves calculating the difference in the UTC and the original date and then doing some formatting to get the HH:MM part correct. See below for (probably over complex) approach
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for the replies. But the in the above output both the dates are showing as 2018-08-29T04:00, how about begin and end times
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
