User Tag List

Results 1 to 6 of 6

Thread: Time elapsed

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Time elapsed

    Does anyone know a good method for calculating the time between when an app was last closed and opened? I've looked at the Time & Date object but I'm unsure how to calculate the time between two dates. Is there a function in MMF for this?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Time elapsed

    Any ideas? I've thought of keeping track of time while the app is open, then saving this value and somehow comparing to something when they open the app again...but it's driving me nuts.

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Time elapsed

    Yeah, I actually just implemented this in my application just the other day. I'll see if I can extract the code for you.

    EDIT:
    Here you go. How to track how many seconds/minutes/hours/days/months since the last time an action has occurred.
    Attached files Attached files

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2007
    Location
    Australia
    Posts
    1,152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Time elapsed

    Thanks for the example! But I don't think the Calendar object is supported in iOS

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Time elapsed

    Oops. Sorry. You said Time & Date, I thought it was the same object.

    Hmm... Sorry, I can't really think of an alternative. If you can find some way of turning the date into a pure integer, comparing them would be easy. Otherwise, you'd have to break apart the string and turn each part into an integer.

    Time & Date doesn't seem to allow you to retrieve the internal system clock in seconds... I can't really find an easy way.

    One method is to convert the current date into a Julian Day. http://en.wikipedia.org/wiki/Julian_day

    Its a cumbersome equation, and requires at least 4 variables... but I think its your only choice. It will give the day as an integer (which you can then compare)

  6. #6
    Clicker Multimedia Fusion 2 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-on
    iamjot's Avatar
    Join Date
    Nov 2008
    Location
    Austria
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm will there be a calender object support for ios one day? Could be interesting for a lot of apps i think.

Similar Threads

  1. [REQ] Compare time elapsed function
    By RhysD in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 5th March 2013, 11:43 AM
  2. time/split time for racing game
    By ptiseigneur in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th September 2012, 06:05 PM
  3. Make a time machine run with lower time complexity
    By Pixelthief in forum Multimedia Fusion 2 - Technical Support
    Replies: 48
    Last Post: 12th March 2009, 10:10 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
  •