playMaker

Author Topic: Time span between two dates  (Read 3328 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Time span between two dates
« on: January 27, 2012, 04:54:30 AM »
Hi,

 Here is a convenient Action to measure the time span between two dates.

You can get it on the ecosystem

or download it here:

GetTimeSpanBetweenDates

Bye,

 Jean
« Last Edit: September 23, 2014, 01:38:09 AM by jeanfabre »

Loganou974

  • Playmaker Newbie
  • *
  • Posts: 18
    • View Profile
Re: Time span between two dates
« Reply #1 on: July 24, 2013, 10:04:24 AM »
Thank you A LOT !!! I mean it !

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Time span between two dates
« Reply #2 on: March 25, 2014, 05:17:34 PM »
Hi Jean,

Would it be an easy modification to get an action to do the following?

User enters their Start Date
Selects the Span
*Inputs a value*
Save output as string

So this calculates a future Date/Time based on the Start Date and the other user entered information.

This would be really handy for time limited in-game events and such if I could just store the current time, and then use an action to give me a new string for Start Date + 60minutes, etc.   :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Time span between two dates
« Reply #3 on: April 02, 2014, 05:59:35 AM »
Hi,

There you go, it's a bit convuluted, because of the timespan formating, so make sure you read this first:

http://msdn.microsoft.com/en-us/library/se73z7b9(v=vs.110).aspx

 typically,
-- putting "1" will add one day
-- putting "1.02:03" will add one day, 2 hours, and 3 seconds
-- putting "0.01" will add one hour.

Bye,

 Jean

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Time span between two dates
« Reply #4 on: April 02, 2014, 08:42:42 AM »
Wow, that's awesome. Thanks so much!!

TBrayner

  • Playmaker Newbie
  • *
  • Posts: 35
    • View Profile
Re: Time span between two dates
« Reply #5 on: April 11, 2014, 02:37:31 PM »
Very cool, tks!

10high

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Time span between two dates
« Reply #6 on: April 08, 2017, 09:31:35 AM »
Hi,

I have a start date of 2/15/2015 and an end date of 3/17/2017 but I get a span of 30 days.

"Get span info" is set to "total days", but I get the same result for "days" (not sure what the difference between these is, TBH).

By my calculation it should be 32 days (if not including the start and end date). What am I missing here?

I hope someone can help me.

Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Time span between two dates
« Reply #7 on: April 09, 2017, 10:42:08 PM »
Hi,

 First, these are not the same year, but I guess you mean 2017 right? I also count 30 days,

https://www.timeanddate.com/date/durationresult.html?d1=15&m1=02&y1=2017&d2=17&m2=03&y2=2017

and so is 2015 for the same range:

https://www.timeanddate.com/date/durationresult.html?d1=15&m1=2&y1=2015&d2=17&m2=3&y2=2015

How do you count 32 days?


also totaldays is a fractional, and days is only whole days:

http://stackoverflow.com/questions/25212667/what-is-the-diffrence-beetween-days-and-totaldays

Bye,

 Jean

10high

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Time span between two dates
« Reply #8 on: April 12, 2017, 09:00:57 AM »
OK, now I feel ashamed. Sorry for wasting your time and thank you for taking it to reply to such a stupid question. I guess my brain was a little fried.

I can't believe THIS was my first question.

Thanks again, and great product by the way.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12342
  • Official Playmaker Support
    • View Profile
Re: Time span between two dates
« Reply #9 on: April 12, 2017, 11:22:19 AM »
Hi,

 Don't worry, no one is judging :) It's actually very important to ask, even if after the solution looks simple, because it's only like that progress can be made, else you are stuck.

 Bye,

 Jean

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 76
    • View Profile
Re: Time span between two dates
« Reply #10 on: April 13, 2017, 06:26:16 AM »
Ohh nice this will come in handy.

Nice work jean

dudebxl

  • Hero Member
  • *****
  • Posts: 602
    • View Profile
Re: Time span between two dates
« Reply #11 on: April 27, 2017, 12:18:03 AM »
Also have Epoch actions in the ecosystem which might be useful...