Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: alternativee30 on July 09, 2012, 03:06:25 AM
-
Regarding the following topic..
http://hutonggames.com/playmakerforum/index.php?topic=1711.0#lastPost
I want the user to be able to input a time format and then take that time formatted string and convert it back into seconds.
I can make individual inputs for Hours, Minutes and Seconds and do the math myself but i am wondering if there is a way to reverse the custom action for Seconds to String.
-
Hi,
look into this:
http://hutonggames.com/playmakerforum/index.php?topic=1047.msg4332#msg4332 (http://hutonggames.com/playmakerforum/index.php?topic=1047.msg4332#msg4332)
this should allow you to get what you want.
bye,
Jean
-
Hey,
The action works great. Only one thing i cant figure out.
I can get it to find the difference between the format
HH:mm
and
HH:mm
But i cant get it to convert
HH:mm:ss
and
HH:mm:ss
(http://s11.postimage.org/6l5lnxd8z/Screen_Shot_2012_07_09_at_2_53_25_AM.png)
(http://s11.postimage.org/7fs59yl3n/Screen_Shot_2012_07_09_at_3_04_25_AM.png)
With a seconds spot it gives me a invalid format string.
(http://s8.postimage.org/3lf16v4z9/Screen_Shot_2012_07_09_at_2_53_40_AM.png)
-
Hi,
you'll need to comply with the available format options.
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx (http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx)
If you can't find what you need, can you provide me with the exact output you expect, and I'll give it a go.
bye,
Jean
-
I only need to take a string formatted in 00:00:00 for hours, minutes, and seconds and find the difference in time between it and 00:00:00.
So i need the result to be total seconds difference between 00:00:00 and 00:00:60 (my example string)
The float stored for my example would be 60 total seconds difference.
-
hi,
ok, I see, so if it was 1 minute and 10 seconds you want to show 70 not 00:00:70 right ?
bye,
Jean
-
Correct.
im using the stored seconds in the float variable for mathmatical equations then converting the seconds back to an understandable time string in HH:mm:ss.
-
Hi,
ok, got confused by this sorry. It's all working ok for me, see attached, I can use HH:mm:ss fine
if that doesn't work, it's likely that the start or end date are not complying to that format. they need to be EXACTLY formated, else you will get that exception.
bye,
Jean
-
hmm weird it works for me as well when i compare straight in the editor. the problem arises when i try to compare it to a string i have stored from getting the "text" property of a NGUI label.
I will mess with it some more and see if i cant find a solution.
-
hi,
what exactly is the string you are inputing? Debug it on the console, then you'll know if that matches the format
bye,
Jean
-
Doh... facepalm... cant believe it :-\
it cant be 00:00:60
it has to be 00:01:00
-
Can this approach factor in more then just days, to be truely calender accurate?
-
Hi,
Yep, with the correct format, it can.
Bye,
Jean
-
This looks like it'll definitely help solve half my problem. However, it doesn't appear that that Minutes option is working for me, it's setup exactly like the other two that work fine. I've confirmed the format I'm using to add time is correct -
DD.HH:MM:SS
Any ideas?
(http://s7.postimg.org/n0khz1ajf/Time_Error.png)
-
Jean?
-
Hi,
yes, sorry, huge back log of pending threads :)
d'oh, it's not implement in the code :)
I have added the action on the ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181).
you can download it here as well. Warning I renamed the file, cause it was clashing with the class name.
GetTimeSpaneBetweenDates (https://github.com/jeanfabre/PlayMakerCustomActions_U3/blob/e6d36a6fea9d9d5b7be07c411ef8aa8065fe5f73/Assets/PlayMaker%20Custom%20Actions/Time/GetTimeSpanBetweenDates.cs)
Bye,
Jean
-
Awesome, thanks sir! I'll give it a whirl later today.
-
Works great!