Question

UTC Timezone in NAC Tenant

  • 4 August 2023
  • 12 replies
  • 300 views

Userlevel 5
Badge +15

Ok. I’m horrible with timezones. 

I’m a little confused though. I want to use the date/time in UTC for a deadline. Users are submiting a form globally. Based on their timezone, the cutoff is 1pm on September 18th. 

Since we can’t turn a form off on a schedule based on local time zone how do I make an email go out if they submit after cutoff day/time?

I did set a date variable in workflow as current date and time. I did a condition on that variable against what time I knew it was in UTC that had lapsed. However, my condition was set for the timestamp is after 08/04/23 and 12:15 am UTC, if so send an email. If not, continue with workflow. 

It’s not recognizing the UTC time in the workflow. I was under the impression when it goes INTO NAC the system converts it to UTC. I also have everything in tenant set to UTC and the workflow set to UTC. I ran the workflow around 12:40 am UTC, which would be AFTER my condition for date/time. I do NOT understand why it’s saying it’s not after that time yet and not sending the email.

 

 


12 replies

Userlevel 5
Badge +15

I realize now if I SET a default date variable in my workflow to fixed date of 08/04/2023 at 12:15 AM, assuming this would be considering UTC time. When I run the workflow and stamp it in UTC (but changed format since to US english so I’m not sitting there scracthing my head with the jargon lol, it’s doing UTC from my timezone which is CST (Houston, TX). 

I’m so lost though, if we need conversion, why would this force us to add time to a date? There is no way we can know what timezone a user would be to cover all the variables or instances of timezones. If I put this in my default value, why is IT not recognizing UTC? 

What am I missing?

Here is my default value for date variable:  

Here is my default settings for time zone: Tenant is also set to UTC though, just FYI.



It works when I add to deadline date by subtracting 5 hours. But not every user is in CST like me. I’m at a loss - I need it to just have a deadline up front of a date and time in UTC. Ugh.

 

Userlevel 5
Badge +15

Here is from Australia user. 

Super annoying - whatever anyone can suggest to get UTC deadline up front would be appreciated. :)
 

 

Userlevel 5
Badge +15

I'm good. Disregard. 

 

Just gonna subtract 5 hrs from deadline since its converting to deadline in my local time reagrdless of user who completes the form. 

Badge +4

I am having the same issue.
I want my form to be UTC. It is going to be a global form.
It would make sense to be able to set the form to be UTC instead of calculating.

Userlevel 5
Badge +15

I personally feel like this is a bug. The settings in workflow should be enforced to datetime variable when default value is set with calendar picker. Why it’s converting to designer/developers local time is kinda lame.

Badge +4

I found something that may help.

First the Time Zone on the form will always be local browser time. I don't see a way to force the form to UTC.
https://help.nintex.com/en-us/nwc/Content/Designer/FormSettingsReg.htm

 

I found a way to convert whatever the Browsers time to UTC

Created several variables.
First is the current Date/time. Not critical but allows visualization.

Variable name: FormatDateNow

    formatDate(dateNow(),"MMMM, D, YYYY, H:mm Z")

 

Then pull the Time zone in UTC+/- format

Variable name: TimeZone

      formatDate(dateNow(),"ZZ")

 

that is a four digit format (example -0400) so need to keep the first 3 digits. So use substring.

Variable name: TimeZoneAdjust

     convertToNumber(substring([Form].[TimeZone],0,3))

 

Then need to Subtract the time zone value from time to get UTC

Variable name: UTCTime     

      dateAdd("hours",-[Form].[TimeZoneAdjust],dateNow())

Format the UTC TIme or by default it will show the local time zone after the UTC time

Variable name: FormattedUTCTime

    formatDate([Form].[UTCTime],"MMMM, D, YYYY, H:mm")

 

Some of these formulas could be combined but it is easier to visualize the steps.

I used Date now to make it easier to test but should work with any date/time variable.

Results:

 

Userlevel 5
Badge +15

I found something that may help.

First the Time Zone on the form will always be local browser time. I don't see a way to force the form to UTC.
https://help.nintex.com/en-us/nwc/Content/Designer/FormSettingsReg.htm

 

I found a way to convert whatever the Browsers time to UTC

Created several variables.
First is the current Date/time. Not critical but allows visualization.

Variable name: FormatDateNow

    formatDate(dateNow(),"MMMM, D, YYYY, H:mm Z")

 

Then pull the Time zone in UTC+/- format

Variable name: TimeZone

      formatDate(dateNow(),"ZZ")

 

that is a four digit format (example -0400) so need to keep the first 3 digits. So use substring.

Variable name: TimeZoneAdjust

     convertToNumber(substring([Form].[TimeZone],0,3))

 

Then need to Subtract the time zone value from time to get UTC

Variable name: UTCTime     

      dateAdd("hours",-[Form].[TimeZoneAdjust],dateNow())

Format the UTC TIme or by default it will show the local time zone after the UTC time

Variable name: FormattedUTCTime

    formatDate([Form].[UTCTime],"MMMM, D, YYYY, H:mm")

 

Some of these formulas could be combined but it is easier to visualize the steps.

I used Date now to make it easier to test but should work with any date/time variable.

Results:

 

What is it’s + hours vs - hours? I’m now having to do this cause i could ONLY get it to send email if past cutoff for same UTC time in workflow. I need to send an email out of it is after the deadline but for their local time. I’m about to pull my hair out with this!

Userlevel 5
Badge +15

Should the negative be there in UTCTime datetime variable? 

Badge +4

What is it’s + hours vs - hours? 

That is the number of hours from UTC the time zone is. US Eastern time is currently (UTC -4) .

If it was Central European Time (Paris, Berlin, Rome) it would be UTC +2) 

This is a good site for checking TimeandDate.com


 

So as the Date Now function always calls the current time on the browser time, to calculate the UTC time there is a few steps.

  1. get the current browser Time Zone -      formatDate(dateNow(),"ZZ")
    1. ZZ is just the time zone number.  Example EDT -0400
  2. ​​​​​​​get the number of hours it needs to adjust by stripping off the last. 2 zeros --    convertToNumber(substring([Form].[TimeZone],0,3))
  3. Subtract the adjustment from the local time to get UTC
    1. So EDT would subtract -4 hours which is actually adding 4 to get UTC. 7pm EDT becomes 11pm UTC
    2. CET should subtract +2 hours which really subtracts 2 to get UTC. 1am is now 11 pm.

So maybe if say your deadline is midnight UTC you compare if the local UTC formatted date is greater than or less than the cutoff.

 

Hopefully this helps.

 

 

Userlevel 5
Badge +13

Hi both,

 

I have also seen this an I believe it is down to a difference in client side/server side context on timezones and the odd way that ISO time works.

 

This formula will strip out the timezone issue and store it properly, I think with the recent release of the time-zoning settings there is always things that will not work as expected, I will see if it is already being addressed for you.


convertToDate(formatDate([INSERT DATE VARIABLE HERE],"DD/MM/YYYY")+" 00:00:00","DD/MM/YYYY, h:mm:ss a")
 

Jake.

Userlevel 1
Badge +5

What I have done in the past is get the TimeZone from the Form using a variable with a formula like

 

formatDate(datenow(),"Z")

 

I then pass that into the workflow and add that to the current date. This will overcome the UTC conversion that happens between the form and WF components. Then use the variable that you create (the one you added the TZ offset to) as the deadline date.

 

Userlevel 5
Badge +15

I ended up just simply putting the current date and deadline in variable on the start form. Everything I tried in workflow designer would NOT work for me to capture a 1pm local timezone subject to user and their region. 

 

then in workflow designer I simply compared those variables - if current date and time was > than deadline then send an email saying the event is now closed blah blah blah….

 

It would be helpful in the future if we could set forms to pause or a way to disable the ability for submissions even if the form is visible on a schedule for events like this. 

Reply