User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: Can I retrieve the unix timestamp with the GET object?

  1. #11
    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)

  2. #12
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,156
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Thank you Schrodinger!

    Actually though, when I thought about it now taking a walk I realized that the unix time is not really necessary like you said!
    The only number I am actually after is how many seconds have passed since the game last saved the time and when the user comes back to the app again. So it just need to calculate how many seconds passed since then. So if it had been 1 day and 2 hours when they come back, then I would need to know how many seconds that are in total. Maybe that would be possible to make it even simpler?

    The reason unix time was useful for this was that I could just compare the old unix timestamp with the new one and get the diffarance in seconds. But yes, maybe that is unnecessary complicated?

  3. #13
    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)
    Yes, if you only need the difference in seconds, we can avoid calculating Unix time,
    but we're probably going to use a similar method like the one in last example
    to be on the safe side we have to take in consideration anyway leap years, numbers of days in months etc.

    you could store:
    year - month - day - hour - min - sec

    on game stop, and fire a loop counting difference like the one in example above

    OR

    we could look in Julian days, I think they could be used to make subtractions.... have to take a look!

  4. #14
    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)
    There is also this extension for Android that has unix timestamp - http://community.clickteam.com/threads/86067-Extension-More-Android-Info

    Not sure if it's still working though.

  5. #15
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,156
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Oh that extension seem to work ! That must be a simpler way to do it then?

    The only problem I have is that this timestamp display 3 digits more, it seems to be displaying not only seconds, but also milliseconds etc. Can I remove the 3 numbers at the end? I always forget how one does that :s

    I recorded how it looks like (must be run on an android device to display it, I run it on my Andy emulator): https://dl.dropboxusercontent.com/u/...-12_165939.wmv

    It is recorded in 10fps though so the numbers goes much faster in reality.

    Andy emulator is here btw, it is really practical for fast testing I have found: http://www.andyroid.net/

  6. #16
    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)
    ahhh great!

    you can divide by 1000 to get rid of last three digits

    but if the number is (likely) too big to be handled by Fusion ( > 32bit int)
    you can use some string manipulation trick
    like:

    left$(str$(timestamp), len(str$(timestamp))-3)

  7. #17
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,156
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Thanks Schrodinger I will see if I don't mess it up

  8. #18
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    Outcast's Avatar
    Join Date
    Jan 2011
    Location
    Sweden
    Posts
    3,156
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by schrodinger View Post

    left$(str$(timestamp), len(str$(timestamp))-3)
    About this to make the number shorter to be able to handle by Fusion and removing the last 3 digits, how should I write it to get an expression that works? I get expression error when trying to do it :/ My full formula looks like this:

    left$(str$(GetUnixTimestamp$( "More Android Info Extension" )), len(str$(GetUnixTimestamp$( "More Android Info Extension" )))-3)

    It seems there are uneven ( ) but where should I place some?

  9. #19
    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)
    Ah, looks like "getunixtimestamp$" is already a string,
    then you don't need the additionals str$()

    so should be simply:

    Left$(GetUnixTimestamp$( "More Android Info Extension" ), Len(GetUnixTimestamp$( "More Android Info Extension" )) - 3 )

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Retrieve timestamp from computer?
    By Outcast in forum Fusion 2.5
    Replies: 3
    Last Post: 10th June 2015, 01:02 PM
  2. how to retrieve value from an object
    By Perry in forum Fusion 2.5
    Replies: 7
    Last Post: 20th May 2015, 02:45 AM
  3. Is there any object like the timestamp object for Android?
    By Outcast in forum Android Export Module 2.5
    Replies: 2
    Last Post: 21st March 2015, 06:09 AM
  4. iOS Unix Timestamp
    By Pharanygitis in forum iOS Extensions
    Replies: 5
    Last Post: 13th April 2013, 08:32 AM

Posting Permissions

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