Solved

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

Posted on 2006-06-10
1
1,887 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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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