Click here to Skip to main content
15,896,338 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Is there any possibility to write a program which will automatically generate the date irrespective of the system date. I mean is there any possibility to write a program in c# where for every run it must show the actual date irrespective of the system date.
Posted

If what you mean is "can I write a program that shows the actual date rather than the date this computer thinks it is?"
then yes - but only if you have access to the internet from the PC.
There are a couple of ways to do that, but the simplest is probably a scrape of the World Clock website[^] or World Time Server[^]

There are webservices out there as well, such as http://www.earthtools.org/webservices.htm[^] which may be better for you to use.
 
Share this answer
 
If your computer is connected to the internet, you can get the current date from a centralized authority (rather than from the system clock of your local computer).

For example, NIST provides implementations of the Network Time Protocol and Daytime Protocol, which can be used to obtain the current date and time over the net.

Here is a sample C# implementation: it's a clock that relies on NIST to provide the time information.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900