Alteryx Designer Desktop Discussions

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

Timestamp of another timezone

SDeora
7 - Meteor

Hi,

 

I need to output the timestamp of another timezone as compared to where the server is.

Example: Server runs on EST but I need SGT in my output. I would generally take DateTimeNow & add 720 minutes to it but would have issues with DST. 

 

Please advise. 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @SDeora ,

 

You can use the below function to convert any Date format(local) to UTC(i.e GMT). Later you can add/sub minutes from it based on Timezone.

DateTimeToUTC(date)

 Hope this helps 🙂

 

If this post helps you please mark it as solution. And give a like if you dont mind😀👍

atcodedog05
22 - Nova
22 - Nova

Hi @SDeora ,

 

Just looked up DST and found this article

 

atcodedog05_0-1601892694431.png

 

I guess you might have to use some if-else block to find month and then take action.

danilang
19 - Altair
19 - Altair

Hi @SDeora 

 

You need to determine if the source value is in EDT or EST and determine if you need to adjust the time value.  The attached workflow generates the specific date and time when the time change occurs for EST.  

 

w.png

You generate the 7 possible days, use a filter to pick the Sunday and then add 2 hours.    Compare this these 2 datetimes with the incoming values. if it's between the spring and fall values, it's DST. Otherwise it's not, MOST OF THE TIME.  The reason it's not always is that the hours get duplicated in November, so you'll get a group of values for 02:00-3:00 EDT and then a group of values for 02:00-03:00 EST.  There's no way to tell by looking at a value in isolation which group it's in.  The best way to get around this is to have the source system return the timezone info.  If you don't have access to this you have to look at all the values in the order that the are entered into the source system.  You can then use a Multirow tool to check if row+1:timestamp is less than the current timestamp.  If Yes then you've switched from EDT to EST.

 

Dan

 

  

 

 

 

 

Labels