-
Clockwork
Im sure you're all getting annoyed with my questions by now, but heres another one.
Is it possible for me to use a timer or something along those lines to create a clock that stay's accurate with my system time? So like, when i close it and reopen it it wont start over, but instead will find my system time and be in check with that still?
Not sure if my question is worded right, but if you understand what im asking for and have a solution, and a little free time. Dont hesitate to reply and tell me how annoying im getting ;)
---Flac
-
look at System.DateTime.Now(). It will give you the current date and time (of your system). look in DateTime for more stuff
ie:
System.DateTime.Now().ToShortTimeString
String.Format("{0:hh:mm:ss}", System.DateTime.Now())
etc...
-
That's the way to do it, but just to add to MrPolite's suggestion, add a timer, set the interval to whatever you want, then update whatever you're displaying with Now.
I do this in an app where I show the time in a panel in a status bar, down to the seconds. Timer's interval is 1000 milliseconds.
Mike
-
but timer's not synchronized with the second ticks of the system clock :p
i'm thinking you could prolly use a thread to detect a change in seconds of the system clock, then update. :p
(don't do what i said. timer's good enough)
oh never mind. i was confused. i guess setting timer's interval to like 100 will be precise enough. i was thinking a loop.