User Tag List

Results 1 to 8 of 8

Thread: Anyway to calculate the difference between two dates in minutes (ANDROID)

  1. #1
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Anyway to calculate the difference between two dates in minutes (ANDROID)

    Hey guys,

    So I'm trying to implement this Lives system that regenerates 1 Life every 20 mins -- even when the app is closed.

    Logically, one has to record the time and date the person quits the app and compare that after re-launching the app with the current date.

    IE. CurrentDate - QuitTimeAndDate = Minutes.

    Then. CountdownTimerOfLives - Minutes.

    I just don't know how to do the (CurrentDate - QuitTimeAndDate) part to get the difference in minutes. I've tried to play around with the Calender Entry and the Time and Date objects but I had no luck.

    Otherwise, is there an alternative method to setup such a system without using servers?

    Essentially, I just need to find out how many minutes have elapsed when the app was closed.

    Thank you,
    Samer.

  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,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The DateTime object found on this page should return the current system timestamp on Android. It's usually a long number which represents the time and date in one value. Using it would be as simple as doing currentTimeStamp - oldTimeStamp / 60 (to convert from seconds to minutes).

    https://www.dropbox.com/s/hj0uncx6as...aTime.rar?dl=0

  3. #3
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi RhysD,

    Thanks for the swift reply.

    I'm having trouble installing the extension, can you remind me where everything goes? Sorry to be a pain.

  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
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,038
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    /extensions folder & /data/runtime folder (there are in some cases different files for both)

  5. #5
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yeah, apparently simply dragging all folders and merging them within the CT folder does the trick.

    Now to figure out how this awesome object works...

  6. #6
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hey RhysD,

    This is an awesome object, thanks a bunch for sharing it with me!

    I just encountered a small problem, though. For some odd reason, my fusion crashes when I attempt to meddle with the object in the Global Editor. Not sure why.

    Can you check if the same thing is happening from your end? Perhaps I installed the extension incorrectly?

    Thanks again,
    Samer.

  7. #7
    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,151
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never used the Global Event editor, so I'm not sure sorry. Perhaps the object isn't enabled for Global events? I know on some objects in their properties you can check an option to make it a global object or not.

  8. #8
    Clicker Fusion 2.5Android Export Module

    Join Date
    Jun 2014
    Location
    London, UK
    Posts
    96
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There isn't an option for that, unfortunately.

    No problem, though. I'll find a work around.

    Thanks again for the great help!

    Samer.

Similar Threads

  1. Android wont calculate large numbers?
    By diefox in forum Android Export Module 2.5
    Replies: 2
    Last Post: 7th July 2016, 09:21 PM
  2. difference between two dates: days,hours,minutes
    By copperbob in forum Guides, Tutorials, Examples, Widgets
    Replies: 0
    Last Post: 19th June 2015, 10:58 AM
  3. Comparer deux dates / compare two dates
    By Juni0r in forum iOS Export Module 2.5
    Replies: 5
    Last Post: 4th July 2014, 02:51 PM
  4. Total hours difference between two dates (timeStamp does not work)
    By Blizna in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 11th June 2013, 11:28 PM
  5. Calculate days/Weeks between 2 Dates?
    By StingRay in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 16th May 2013, 07: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
  •