Skip to main content
Nintex Community Menu Bar
Solved

Convert a value to DateTime is off by a day


Forum|alt.badge.img+8

I have a workflow in Nintex Automation Cloud that uses “Convert a value” to convert Text variable to DateTime variable but the date is off by 1 day -

 

Example: if the input is this,

2/6/2024

the output is this,

2/5/2024 18:00:00 PM

 

The “Convert a value” parameters look like this:

Source value = (a Text variable)

Target type = DateTime

Source dateTime format = M/d/yyyy

Source locale = United States (en-Us)

Result = (a DateTime variable)


Also, the Timezone settings in the workflow are:

Box checked for “Use the tenant’s default regional settings for this workflow” where Tenant default time zone is (UTC-06:00/UTC-05:00) America/Chicago.

 

Best answer by bsikes

My assumption would be that it’s taking the string “2/6/2024”, and converting that to the date/time of 02/06/2024 00:00:00. Then, it’s adjusting for the time zone you set (-6 hours from UTC), resulting in 02/05/2024 18:00:00

View original
Translate
Did this topic help you find an answer to your question?

3 replies

Forum|alt.badge.img+10
  • Scout
  • 129 replies
  • Answer
  • February 1, 2024

My assumption would be that it’s taking the string “2/6/2024”, and converting that to the date/time of 02/06/2024 00:00:00. Then, it’s adjusting for the time zone you set (-6 hours from UTC), resulting in 02/05/2024 18:00:00

Translate

Forum|alt.badge.img+8
  • Author
  • Apprentice
  • 64 replies
  • February 1, 2024

Yes, that’s it!

 

I tested something out.  

I changed the workflow settings to use no timezone offset (make it GMT).  So "2/6/2024" converts to a DateTime of 2/6/2024 at midnight.  That's better.  But I don't want task escalation emails to be sent out at midnight.  So I need to append a time to that string before I convert to DateTime.  That STILL causes a timezone offset issue because when I get the current time of the workflow it is for my local time.

 

I’m working on a few different workarounds.  There’s no easy solution but we’ll figure something out.  Thanks.

Translate

Forum|alt.badge.img+10
  • Scout
  • 129 replies
  • February 1, 2024

In some of my workflows that have a timing aspect to it, I have a variable that contains the number of hours needed to adjust a time to the expected time zone. After I have the string converted to a datetime variable, I use the “Add time to date” action to add the “hours” variable to the converted variable to get the correct time.  Mainly, this is to make it easier to account for silly things like daylight savings time.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings