Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

How to generate begin and end dates in UTC?

Highlighted
8 - Asteroid

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?

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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

Highlighted
12 - Quasar

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

2018-08-29_17-17-13.png

 

Highlighted
8 - Asteroid

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

Highlighted
12 - Quasar

Is this correct? I think I misunderstood the format required.

 

2018-08-30_11-20-37.png

Labels