User Tag List

Results 1 to 8 of 8

Thread: Calculate days/Weeks between 2 Dates?

  1. #1
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Calculate days/Weeks between 2 Dates?

    Is there a Way to calculate the days or Weeks between 2 Dates?

    Just with the Standard extensions and maybe a Little math?!?

    Thanks for your help!

  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)
    You can use a timestamp to achieve this I think there are a few timestamp extensions floating around. They basically return a long number that is based on the current date and time. To get the difference you just subtract the old timestamp from the new one. I think it returns milliseconds or something; then convert those to the numbers you need.

  3. #3
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I think of converting to Android, so there's no timestamp ext for that

  4. #4
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    No, i have a app where you setup and Start and end Date and After this the app Shows a individual Countdown (Real Time)

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,366
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    MMF really lacks in this department!
    However, it is possible to do without extensions.

    Eliyahu came up with this exellent formula for me:

    ((Int((Year-2001)*(365.25))+Min(1, Max(0, Month-2))*Max(0, (1-Year mod 4))+Month *30+(Month+Month/8)/2-2*Max(Min((Month-2), 1), 0)+Day)*24*60)+Hour*60+Minute

    It converts a date into minutes. Leap years are taken into account as well. If you convert two dates you can then find the difference.

    I've attached an example


    Of course, if anyone could make this into an extension it would be awesome. As it is now, it is quite a bit of work when setting up new dates to compare.
    Attached files Attached files

  6. #6
    Clicker

    Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    StingRay's Avatar
    Join Date
    Nov 2006
    Location
    Austria
    Posts
    1,057
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thanks, Popcorn!

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    tompa's Avatar
    Join Date
    Nov 2011
    Location
    Uppsala, Sweden
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    shouldn't be a problem

    extracting weeks from days
    A = days between dates

    A / 7 = weeks to event
    A mod 7 = days to event

    or A - (7 * (A / 7)) = days to event (fusion logic)

    great work popcorn!

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    conceptgame's Avatar
    Join Date
    Apr 2011
    Location
    Switzerland
    Posts
    776
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Note that this formula is not valid forever: 2100 is not a leap year for example. But I don't think that it matters for your application.
    Leap Year is: (Year mod 4 == 0 AND Year mod 100 !=0) OR Year mod 400 == 0 and not only Year mod 4 == 0 as it is in the formula.

Similar Threads

  1. My app is available for two more weeks...then it's gone!
    By ratty in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 10th June 2013, 03:04 AM
  2. Been Waiting 2 Weeks For My Copy Of Click Disc
    By Kimera in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 13th November 2009, 01:58 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
  •