A Time synch problem...

Is it possible to synch the time of your region, with a timer in blender? Just wondering…

you mean we can get the current time from the computer into blender

Yes that is the question :slight_smile: Well not exactly, I want the time of your region, like if you live in the London, Dublin section it will be GMT +00:00 and so forth… Is it possible?

Well, definitely not with logic bricks;)
For that you’d need to get it to import the time off of your system clock, or possibly the Internet if you want to be exact. I think there’s probably a way of accessing the Internet with Python, but it would be complicated, especially getting the time from it…

there is a time module in python. check it out, maybe it can help you.

Where can I find this “time module” ?

download python… read the documentation… they go into all the modules that are included with blender in the python24.dll file… you can import them into your script and use them to do cool things like get the system time…

James XVI,

####Import Date Module#######
from datetime import date
 
######Import Local Time######
from time import strftime
 
#####Set Values######
time = strftime("%H:%M:%S")      #Hours, Minutes, Seconds
now = date.today()   
 
##############
print now  #Prints Date
print time #Prints Local time

Hope that helps.

Edit:
Need to have Python 2.4 installed!!!

Thanks alot mate :slight_smile:

Well here is the file I made, where is the bugger in it?

James XVI,
Step one is to reomve the text in the Property of the plane, must be blank.
Second,

####Import Date Module#######
from datetime import date
 
######Import Local Time######
from time import strftime
 
g = GameLogic
c = g.getCurrentController()
o = c.getOwner()
time = strftime("%H:%M:%S")
o.Text = time  # used to be --- o.Text = o.Time, must be o.Text = time
 
#Text is the property created(Int, String, Float, Boolean, ect..) for of object
##################################
# now = date.today() #
# LT = strftime("%H:%M:%S" Local Time

Hope that helps.

Here is another one, only now I can’t get the date to synch, I dont get any returned errors in the log… :frowning:

The date is the wrong data type for the string property. Convert the date over to a string by using str(now):

o.Text = str(now)

Thank’s a million man :slight_smile: