需要有关日期的小信息. [英] Need a small info regarding date.

查看:56
本文介绍了需要有关日期的小信息.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能编写一个程序,该程序将自动生成日期,而与系统日期无关.我的意思是有可能用c#编写程序,其中每次运行都必须显示实际日期,而与系统日期无关.

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.

推荐答案

我可以编写一个显示实际日期而不是计算机认为的日期的程序吗?"
那么可以-但前提是您可以通过PC访问互联网.
有两种方法可以做到,但最简单的方法可能是世界时钟网站 [ ^ ]或^ ]

也有Web服务,例如 http://www.earthtools.org/webservices.htm [ ^ ],可能更适合您使用.
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.


如果您的计算机已连接到Internet,则可以从集中授权机构(而不是从本地计算机的系统时钟)获得当前日期.

例如, NIST 提供了此处是示例C#实现:它是依靠NIST提供时间信息的时钟.
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.


这篇关于需要有关日期的小信息.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆