Using time

Blitz3D Forums/Blitz3D Beginners Area/Using time

po(Posted 2005) [#1]
I have a game that has something you can only do once a day, so I need some code to run if the computer clock says it's 12:00 pm. I think I've seen it done before...
Would it be possible to do something like this:
If CurrentTime()=24,0,0 Then
code
EndIf



GfK(Posted 2005) [#2]
If Left$(CurrentTime(),5) = "12:00"
  ;code
EndIf



n8r2k(Posted 2005) [#3]
This will let you do exactly 12:00 pm
If left(CurrentTime(),8) = "12:00:00"
code 
EndIf

Nice code by the way GFK


po(Posted 2005) [#4]
Thanks, but something wierd happened when I used that code. My computer clock stopped, or atleast the little one at the bottom right of my screen did. If I double click on it it still displaus the current time. Odd though, I will try restarting my computer.


n8r2k(Posted 2005) [#5]
Did you try selecting the Adjust Date/Time option? That should show the current time. Post your code and I can help you.


po(Posted 2005) [#6]
Hmm, clock seems to work fine now.


n8r2k(Posted 2005) [#7]
K


Rook Zimbabwe(Posted 2005) [#8]
Thats weird... I tried it on XPpro (athlon 64 etc.) and it didn't stop anything. Had to wrap it in a B3D codelet...
-RZ


po(Posted 2005) [#9]
Yea, I think it was just a one time thing with my crappy computer.