Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: jeanfabre on January 27, 2012, 06:54:30 AM
-
Hi,
Here is a convenient Action to measure the time span between two dates.
You can get it on the ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181)
or download it here:
GetTimeSpanBetweenDates (https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/e6d36a6fea9d9d5b7be07c411ef8aa8065fe5f73/Assets/PlayMaker%20Custom%20Actions/Time/GetTimeSpanBetweenDates.cs)
Bye,
Jean
-
Thank you A LOT !!! I mean it !
-
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. :)
-
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
-
Wow, that's awesome. Thanks so much!!
-
Very cool, tks!
-
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.
-
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
-
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.
-
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
-
Ohh nice this will come in handy.
Nice work jean
-
Also have Epoch actions in the ecosystem which might be useful...