A pretty handy dandy asset you can use for a game if you need something to happen based on a current time or simply need a real time clock.
I have it so that it shows the seconds as well as minutes and hours but you can change it to display any combination of the current Year, Month, Day, Hour, Minute, and Second. Simply change line 17 of the script to what you need. Even if you don't know python, I'm sure you can do it.
There was a problem with the analog clock but I just fixed it; so if you want to download the updated version, please do.
Thanks, but how can to do to always have 2 digits on the digital clock ?
Go into the python script for the digital clock and you should see some lines that say something like own["seconds"] = datetime.seconds
just delete those lines and it should work.
Sorry but I do not understand. The Python script to the digital clock contains the indicated lines. Here is the script:
import bge from bge import logic import datetime
cont = bge.logic.getCurrentController() own = cont.owner
time = datetime.datetime.now()
own["Year"] = time.year own["Month"] = time.month own["Day"] = time.day own["Hour"] = time.hour own["Minute"] = time.minute own["Second"] = time.second
own["Text"] = (own["Hour"] + ":" + own["Minute"] + ":" + own["Second"])
Ok in the last line take out from own["Text"] = (own["Hour"] + ":" + own["Minute"] + ":" + own["Second"])
+ ":" + own["Second"])
so you get own["Text"] = (own["Hour"] + ":" + own["Minute"])
Thanks, but I think you have not understood the question ? or I badly worded in early ! So, for now, your code displays time like that "19:5:2" and I would like to see "19:05:02". How to do ?
Great blend @NicholasAnderson Handy setup Thanks for sharing. :)