Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Populate Time zone along with Timestamp

NidhinGD
7 - Meteor

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

 

2 REPLIES 2
DataNath
17 - Castor
17 - Castor

@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

NidhinGD
7 - Meteor

@DataNath 

 

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.

 

Labels