Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

UTC to Central Time conversion

ArnabSengupta
8 - Asteroid

Hi All,

 

I have a dataset in which the time stamp is in UTC. I want to convert it into Central Time (CDT/CST) ,including the daylight saving time switches(CDT= UTC-5, CST=UTC-6). I cannot use [DateTimetoLocal] function because our Alteryx server runs on GMT. If I use this function the the time stamp will get converted into GMT instead on CDT/CST.

 

How can I convert this time stamp in Central Time (CDT/CST) , with taking into consideration of daylight saving?

 

I have attached a sample dataset to the question.

 

Help is much appreciated.

 

Thank you

3 REPLIES 3
Emil_Kos
17 - Castor
17 - Castor

Hi @ArnabSengupta,

 

Can you check if the second answer in this topic meets your needs?

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/EST-to-UTC-with-daylight-savings/td-p/...

 

Please let me know if it works.

 

 

JohnJPS
15 - Aurora

I'm surprised to see how little is out there for something of this nature. Based on Wikipedia's discussion, it looks like Daylight Savings runs from the 2nd Sunday in March to the first Sunday in November every year, kicking on or off at 2:00AM.  With that in mind I created a simple iterative macro that does a time shift and then (assuming it's a relevant locale in the US), adjusts for Daylight Savings. I've attached it here along with a simple example that runs a few dates through it.

 

The initial shift is by an offset... put in 5 for EST, 6 for CST, 7 for MST or 8 for PST.

 

I encourage testing and tweaking if anything is not right. I didn't spend much time on it. It's just a start with only a bit of the tedium out of the way.

JohnJPS_0-1598193920957.png

 

goatley1
7 - Meteor

I'm trying to leverage your macro, however it times out at 100 iterations.  Can this be changed within the macro?

 

Labels