Date field \losing a day\" when creating item"


Badge +8

Hello Fellow Nintexperts,

While working with a client today, I've come across an interesting issue. Despite developing a work-around already, I'd love to get some insight from the community to better understand my finding or to surface this bug. In order to confirm this issue wasn't unique to my client's environment, I recreated the issue in my development environment as well (see below).

I have two SharePoint Lists:

  • TEST A
  • TEST B

Both of these Lists have a date column called Some Date configured with the default settings (Date Only). I am then using a Site Workflow to fetch the Some Date value from a single item in the TEST A list, setting this value to a workflow variable (configured as a date), and am then creating a new item in the TEST B list based on this value.

What I'm finding is that when taking this route, the date stored in the second list loses a day (see screenshots below).

Query List > Set Variable > Create Item using variable

Any ideas on what would cause this behavior? I suspect it has to do with how time is being handled with converting from item value to variable and back to a list item value, but it threw me for a loop.

As silly as it sounds, I worked around the problem by adding a Calculate Date action before the Create Item action is called. It doesn't actually do anything. It simply adds zero time and stores the value back as the original variable:

After doing this, the correct date is shared to the new item. Any ideas?

Environment Details:

Nintex Workflow for SP2013 (version 3.2.3.2).


19 replies

Badge +8

Just wanted to check back in here – anyone run into a similar situation?

Badge +16

Hey just been looking at this for you.  I got the exact same dates but I did the workflow slightly differently - what do you think?

Badge +8

Thanks for taking a look Cassy Freeman‌! It's one of those situations where I was able to work-around/resolve the bug a number of different ways, but I believe it's a bug nonetheless.

In fact, if I had designed this workflow myself, I doubt I would have taken the path that led to the strange behavior in the first place. I really just wanted to expose it in case it's something worth lobbing into the dev team's backlog.

Badge +16

oh ok hold on I just changed the workflow to:

  1. query list a for one item and pull Some Date into text variable vTextSomeDate
  2. used Set Variable to set date variable vDateSomeDate = vTextSomeDate
  3. Created item in list B using vDateSomeDate

is that the same as your scenario?

The date was the same.  It didn't add a day.  Let me know if I have got it wrong so that we can see if this is a bug.

Badge +8

Sure Cassy Freeman‌ no problem! Here's my workflow if you'd like to download and take a look:

https://nintexassets.blob.core.windows.net/wfs/New_Workflow.nwf 

It's really just two actions – Query List and a Create item:

To keep the test-case simple, my Query List action is filtered by the first item in the TEST A list (i.e. ID = 1). Here's that action's configuration:

myDate is simply a Date and Time variable:

After I've pulled the date into this variable, I am simply creating an item in the TEST B list (see configuration below):

Badge +16

ok finally have the same as you - and the date works fine.

But maybe it's because our dates are different to yours i.e. dd/mm/yyyy?

Badge +8

Haha so you're telling me it's a #MURICA problem eh? wink.png

Badge +16

hahahahahahahahahahahahahaha yup!

Userlevel 5
Badge +12

Hello

Not sure if this was addressed, but are you two running the same exact versions of workflow?    (those pesky little version numbers...).

Could be a bug, or it could be that you are setting a default value somewhere and its just appearing as a bug - the date isn't updating from its original value.   If you disable the workflow and create the item, what value is in the date for that item?    

Badge +16

good shout ‌.  Using on-prem 2013 3.2.3.2

Badge +8

Hello Mike Matsako‌ – thanks for the suggestion! I've confirmed the issue isn't spawning from default values, and it looks like Cassy Freeman‌ and I are using the same version of workflow.

I have reproduced the issue in more than one SP2013 environment, so I don't think this is a false positive involving user error. That said,Cassy Freeman has confirmed for me that Nintex UK > Nintex USA. happy.png

Badge +2

Odd as it sounds; I seem to have viewed a time difference of about four hours between servers. And, I am wondering if that difference impacts this at all. I am having the same problem. A date only is one thing in one list and one day less in the other. I know Sharepoint and Nintex treat the date as midnight of the first day. I wonder if somehow that four hour difference is impacting.

Badge +2

I noticed in the workaround that you calculate your date in Local time vs UTC which for us is a four hour difference.

I think nintex may by default store in UTC...

206266_pastedImage_2.png

Badge +8

Jeff Vojtko‌ – what's odd here is we're never leaving the context of this site collection (two lists in the same site). It's got to be something with translation from SP column to nintex wf variable and back to SP column.

Badge +8

Jeff Vojtko‌ – ah good catch! Let me test a variation using UTC.

Userlevel 3
Badge +8

I'm having the same issue. I think maybe I'll just add a day with the workflow so when it creates the item it's the correct date.

Patrick Abel‌, were you able to resolve the issue or did you use a similar work around?

Thanks

Kassie

Badge +8

Hello Kassie,

I was able to resolve this issue by adding a "Add time to Date" action that doesn't actually manipulate time in the variable. I didn't add any days, hours, minutes, etc. to the date variable, but simply including this action and re-set the date to the same variable.

This resolved the one day off issue for me (I've seen this a time or two with clients).

Badge +11

Time is: Local - not in 365 configuration

Badge

I have the same issue, kindly explain your solution again

Reply