Solved

How to override DateTime.Now to get date and time from the internet

Posted on 2006-06-10
1
1,926 Views
Last Modified: 2008-03-10
Hello... I want to  override DateTime.Now to get date and time from the internet, preferrably atomic time.  I haven't a clue where to start.  Can someone point me in the right direction?

Thanks...
0
Comment
Question by:rmmarsh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
aaronfeng earned 500 total points
ID: 16877990
DateTime class is a sealed class, so it means you can't inherit and override any functions.  What you can do is to create your own custom DateTime class.  If you want the time from the Internet, you need a way to synchronize with the NTP servers which means you'll have to create a client that connects to the servers.  Here is an example: http://www.codeproject.com/cs/internet/ntpclient.asp  If you dig around codeproject I'm sure there are other examples.

Cheers,

Aaron
http://geekswithblogs.net/afeng
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question