Results 1 to 4 of 4

Thread: Clockwork

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Middle of nowhere
    Posts
    45

    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
    Everything great once started with the words "That will never catch on, you shouldnt even bother" be great, go against the crowed, do something stupid, you might become famous.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    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...
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    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

  4. #4
    Addicted Member
    Join Date
    Oct 2002
    Posts
    210
    but timer's not synchronized with the second ticks of the system clock

    i'm thinking you could prolly use a thread to detect a change in seconds of the system clock, then update.

    (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.
    [vbcode]
    Me.Hide()
    [/vbcode]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width