Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
how to develop a clock or time control in which i want to change time manually and it wont depends on the system time(DateTime.Now) using C#
Posted 7-Jan-13 19:08pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I just answered this. If you have any other questions, then edit your question. You can use a timer, but it's more precise to let the system time do it's job and for you to just store the offset from the time you want to show, and the time the system knows. Otherwise your time can drift because windows timers are not reliable.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

As Christian says, store/use an offset to calculate your application's 'time'. If you want no tie to the system time then us SNTP[^] to get the real time and use your offset although this will require an internet connection and periodic checks to keep it accurate.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 365
1 Maciej Los 232
2 OriginalGriff 213
3 BillWoodruff 79
4 Jose Garcia Sevilla 75
0 OriginalGriff 7,953
1 DamithSL 6,139
2 Sergey Alexandrovich Kryukov 5,454
3 Maciej Los 5,293
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web02 | 2.8.141223.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100