[Plugin] System date and time

1 favourites
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • UnixTimeStamp - that will be handy. Now it will be easy to make all types of waiting mechanics even if the game is not running.

  • xoros

    Uh, I had made another plugin named time away, which could get the elapsed interval of turned off game (not running) from webstorage.

  • even better!

  • Hi Rexrainbow

    I'm trying to use your plugin to determine if a current day is on a weekend or a weekday. I came across this example that's done in php talking about unixTimestamps etc like your plugin supports, but im not sure how to translate it into construct 2

    http://stackoverflow.com/questions/9553 ... or-weekend

    Is there a simple way to determine if its a weekend or weekday with your plugin?

    thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Does your Date plugin always grab the Date() from the System clock? I have been trying to get server time (in a UNIX timestamp format) via an AJAX call, but the clock seems to be displaying my local system time, not the server time that I gave the timestamp in your example.

  • Does your Date plugin always grab the Date() from the System clock? I have been trying to get server time (in a UNIX timestamp format) via an AJAX call, but the clock seems to be displaying my local system time, not the server time that I gave the timestamp in your example.

    I am not sure, this is the source code for UNIX timestamp.

    var today = new Date();
    UnixTimestamp = today.getTime(); [/code:3a0bi7bl]
  • Right, I'll tweak it to not do that. I want it to error off if the AJAX call fails. Thanks for your awesome plugin.

  • Rex rox. Thanks for the plugin. \o/

  • rexrainbow - thanks so much for all your amazing work. I was noticing the 'time away' plugin doesnt seem to work on mobile if you're just 'pausing' the game by hitting the home button and returning. it only seems to work if you actually **close** the app then return later. Is there some way to get it to work for simply switching away from the app then switching back?

    Thanks again! Crazy good stuff.

    Nate

  • rexrainbow - thanks so much for all your amazing work. I was noticing the 'time away' plugin doesnt seem to work on mobile if you're just 'pausing' the game by hitting the home button and returning. it only seems to work if you actually **close** the app then return later. Is there some way to get it to work for simply switching away from the app then switching back?

    Thanks again! Crazy good stuff.

    Nate

    Call action start timer every tick or every second then you will not miss any kind of pausing I guess.

  • rexrainbow -- yeah i completely forgot there was a browser action called 'On Resume' which i could use too, i haven't tested yet, but im sure if i set it to check for time-away "On Start of Layout" and "On Resume" i should be good

    thanks so much for all your amazing work!

  • what was date.count again?

  • krish

    expression: date.count will return the number of existed date object, like Sprite.count.

  • This looks to be a brilliant plugin and the time away is exactly what I'd need for the game I have in mind.

    I am, however very new to Construct 2 and I'm having difficulty in figuring out how to get it to work.

    Would someone be kind enough to maybe run up a little demo showing what I should be doing?

    I'm really after having the time away displayed on screen and maybe even include the On Resume coding too.

    I realise its a lot to ask but really, if I can get that piece of code sorted, Im a happy bunny.

    I'm thinking of purchasing the personal licence and it'd be the defining point.

    Many thanks in advance.

    UPDATE: Never mind, guys.... I figured it out.

  • Document, plugin and sample capx are included.

    time away plugin, Get elapsed interval of turned off game from webstroage.

    where the link to download in your page?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)