1

I'm using a 2013 workflow that starts on creation, and the Find days between dates code. I'm getting the time from the "Due Date" field on the list, it comes with a time, so I set time for 12:00:00 in the first step. Here is the whole workflow enter image description here

And this is what I get in the log: the date, 1/4/2016 12:00:00 AM, then the date variable and the time variable which is the days in between.

enter image description here

I should be getting 116 in time variable obviously. I've tried setting the date, 1/4/2016, to a date variable first then use the variable in the code but I still get the same results.

  • So there are 385,920 minutes between 1/4/2016 12:00:00 and 9/28/2016 12:00:00 but if I run a workflow on SharePoint to make this calculation it calculates there are 385,860 minutes, 60 minutes less! That's why I was getting a weird number between dates. – Marker Sep 28 '16 at 19:09
  • Is this a leap year issue? – Marker Sep 28 '16 at 19:35
0

Ok I figured it out! The 60 minute loss is from daylight savings time. So I have to put in my code, if the date being checked is during daylight savings time, add 60 minutes.

  • okay, Great you figured out. just curious, is there anything in SPD workflow which will indicate that daylight saving is started? – Gaurravs Sep 29 '16 at 4:06
  • Gaurravs - actually that was going to be my next question / comment! I think I'll need a new question posted!? I was just looking at REST API functionality (I've never used in SP before) in SP for another project. I'm wondering if I can use that on a site that tells me yes or no that we are in Daylight savings time and if so add the 60 minute difference? – Marker Sep 29 '16 at 15:36
  • I figure out a much simple solution to my issue - I check the long date, which will display like, "Saturday, November 19, 2016". Then I check to see if the due date contains Saturday or Sunday, and if so, add the appropriate number of days so the due day doesn't fall on the weekend. – Marker Nov 15 '16 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.