Solved

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

Posted on 2006-06-10
1
1,912 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

729 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