User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Convert Chrono to String

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert Chrono to String

    I wonder if anyone can help?

    I basically am using the time and date / chrono function. When the user clicks start, it starts counting up (stopwatch style). When the user presses stop, i need this value in a string so that i can upload it to my php table.
    I have tried the special/convert value to string but it doesn't really help.

    Also, is it a bad idea to use the chrono for a way of keeping time?

    The chrono function seems a bit bugged on the pc, but works fine on my android.

    edit: i have followed some of the search replies but haven't had so much luck.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    In which format you need this timestamp to be?
    Basically, to have it in a string, you would just have to do something like:

    Str$( seconds of( "Date & Time" ) ) + ":" + Str$( minutes of( "Date & Time" ) )+ ":" + Str$( hours of( "Date & Time" ) )

    If you need low digits values to have trailing zeroes, just do i.e.:

    Left$("00", 2 - Len(Str$(minutes of( "Date & Time" ) ) ) ) + Str$(minutes of( "Date & Time" ) )
    (for fixed 2 digits)

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll give this a go, thanks.

    I basically want it in 00:00:00 format.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Than this should do:

    Left$("00", 2 - Len(Str$(hours of( "Date & Time" ) ) ) ) + Str$(hours of( "Date & Time" ) ) + ":" + Left$("00", 2 - Len(Str$(minutes of( "Date & Time" ) ) ) ) + Str$(minutes of( "Date & Time" ) ) + ":" + Left$("00", 2 - Len(Str$(seconds of( "Date & Time" ) ) ) ) + Str$(seconds of( "Date & Time" ) )

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Nice working out schrodinger, For noobs or users that would prefer cut and paste:

    Left$("00", 2 - Len(Str$(hours ) ) ) + Str$(hours ) + ":" + Left$("00", 2 - Len(Str$(minutes ) ) ) + Str$(minutes ) + ":" + Left$("00", 2 - Len(Str$(seconds ) ) ) + Str$(seconds )

  6. #6
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,241
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Another way...

    Right$("0"+Str$(hours of( "Date & Time" )), 2)+":"+Right$("0"+Str$(minutes of( "Date & Time" )), 2)+":"+Right$("0"+Str$(seconds of( "Date & Time" )), 2)

    By taking the right side there is no need to calculate the length.
    DT
    Special Projects Director

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Anyone know what formula to add to the above to work milliseconds as well? Many users have asked for a solution in the past yet in the forums no one has posted a simple solution.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    awesome work guys!

    My only slight issue is that using: Left$("00", 2 - Len(Str$(hours ) ) ) + Str$(hours ) + ":" + Left$("00", 2 - Len(Str$(minutes ) ) ) + Str$(minutes ) + ":" + Left$("00", 2 - Len(Str$(seconds ) ) ) + Str$(seconds )

    The time actually starts as soon as the frame has started. If the user clicks the START button say, 10 seconds after opening the app - the time is already sitting on 10 seconds.

    I'm assuming this is as it's using system time and not the date and time object.

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module
    aenever's Avatar
    Join Date
    Jun 2013
    Posts
    1,413
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Timer example on start of game

    Hi Redsquirrel,if you use my cut and paste example just set the timer to zero when the user clicks the start button. Here's an example using the spacebar as the trigger

    Timer.mfa

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DT View Post
    Another way...

    Right$("0"+Str$(hours of( "Date & Time" )), 2)+":"+Right$("0"+Str$(minutes of( "Date & Time" )), 2)+":"+Right$("0"+Str$(seconds of( "Date & Time" )), 2)

    By taking the right side there is no need to calculate the length.
    I like this more than mine

    @ aenever: I was thinking Redsquirrel needed that for a Date&Time object,
    that would do with cut and paste if the user has a "Date & Time" object named "Date & Time" ()

    @ Redsquirrel: minutes/hours/seconds written alone IS system (application) time,
    for "Date & Time" reference use minutes of( "Date & Time" )

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Convert Value > String ???
    By Akuma in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 20th June 2016, 11:40 AM
  2. Get size in pixel of a string (or convert string length to pixel)
    By iOSC in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 21st March 2013, 06:30 PM
  3. Chrono versus custom chrono
    By mickarrow in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd November 2010, 02:05 PM
  4. How to convert the Date/Time to a string?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 8th June 2010, 03:37 PM
  5. Convert picture to string
    By YAS in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th September 2006, 05:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •