android get current time?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I want to take the current time, and add a value, so the value could be 25 hours could be 2 hours etc.
    How can I get the time and add the value so it calculates the time + the value
    So if its 5.00pm and I add 20 it will display the time as 1pm

  • You can use the Date & Time object to get the current time of the device(in hours for example).

    I'm not sure what you want exactly.
    You need the value to control the time of the phone or do you just want to synchronize your own clock in the game with the device time?
    Can you explain in a bit more detail what event you're trying to create here?

    Currently working on ... [SIGPIC][/SIGPIC] ... a Puzzle Platformer

  • I want a timer in the game to sync with the phone time, then be able to add to it.
    So the user can add time on and the time will add to the timer.
    So if its 8.20 am and the users clicks add 2 hours it will display 10.20
    also the ability to show the day would also be good so displays monday, then if the clock passes 24.00 it will display the next day

  • This means you only need the phone time to sync hours/minutes/also seconds? + day with your game clock? And after syncing you don't need to check phone time again(except you wanna sync again) and your game clock is just running and you also need the ability to change the game time independently? Do you want this for a clock(with graphics) in your game? Can you explain how you display the time in your game actually?
    I would make an example for you then.

    Currently working on ... [SIGPIC][/SIGPIC] ... a Puzzle Platformer

  • yes i only need to current time once, then add a value to it.
    i have been using counters to display the time in the game
    not sure if this is the best thing to use
    it only needs to use the current time as a base figure to start with then add to the time and calculate the time + the day of the week

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!