Hi
I am trying to populate time zone is a DateTime field but i was not getting any option to do teh same.
Is this possible in Alteryx in some way.
Field Value : 2022-10-19 11:10:18
Required output : 2022-10-19 11:10:18 UTC
But the output field should remain as a date time field
If I use DateTimeFormat ([Datefield],"%Y-%m-%d %H:%m:%S %Z") is will give me Local Timezone, even if i apply DateTimeToUTC() prior to formatting
Formula used : DateTimeFormat(DateTimeToUTC(DateTimeNow()),"%Y-%m-%d %H:%m:%S %Z")
I understand that we can cast it to string and add UTC as a suffix. I am looking for an option if i can keep eth field as a DateTime field after adding the suffix (UTC)
Thanks in Advance
Nidhin David
Solved! Go to Solution.
@NidhinGD unfortunately there's no way to maintain the DateTime data type whilst adding the time zone suffix. Alteryx only recognises ISO formats (YYYY-MM-DD HH:MM:SS) and anything else will be processed as a string. Is there a particular use case you're precious to keep the data type for? Perhaps we can just adjust your downstream approach if so. Hope the info helps, more about DateTime here: https://help.alteryx.com/20221/designer/datetime-functions
Thanks. I was trying to avoid a query statement for Table creation. Since I am not able to add Timezone to the values, i have created a macro to create the required table as a Pre SQL in Output tool. That way i can keep the data type and value as needed.