Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
Hi Is it possible to get real date (not system date) without any connection to internet? I developed my application by C#. DateTime.Now gets system date but I want to know real date because system date may be wrong. Is it possible?how to do this?
Posted 17-Jan-13 21:33pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

No. You can use SNTP to get the real date and time (see this[^] and this[^]) with an internet connection. If you have a network connection that the computer can use where a computer exists that does have an internet connection, then you can use that as an SNTP server for the client. Otherwise, you are stuck with the System's date/time.
  Permalink  
Comments
BC @ CV at 18-Jan-13 10:01am
   
Cool! I didn't know such a thing existed. +5
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
The computer know which we set on it,(if we set some date for it, then it show the same); but if it didn't know the date then how can It produce date for you for any programming language.
eg. If I put you in a dark room for several days without any gadget/communication(clock) then Can you identify what is real time or date, same for computer(if you Initialize wrong clock to computer then it return you wrong time)
 
you cant get real date without setting on your computer.
 
So If you can create your clock then you can set it first time with real date and you will returned always real date time.
 
Thank You.
Please mark as ans. if it helps you.
  Permalink  
v3

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

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 120
4 BillWoodruff 85
0 OriginalGriff 6,045
1 DamithSL 4,611
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 18 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