如何在没有互联网连接的情况下获得全球日期和时间(非系统日期和时间)(使用C#进行winnforms) [英] How do I get global date and time (not system date and time) without internet connection ( winnforms with C#)

查看:137
本文介绍了如何在没有互联网连接的情况下获得全球日期和时间(非系统日期和时间)(使用C#进行winnforms)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

How do I get Global Date and Time (Not system Date and Time) without internet connection ( winnforms with C#)





我尝试了什么:



我已经尝试了所有可能的方式,没有获得日期和时间没有互联网连接



What I have tried:

I have tried all posssible way not not getting date and Time without internet Connection

推荐答案

你不能。除非您连接到外部时间源 - 例如互联网 - 否则您拥有的唯一时间源是系统时钟。



想想它就像在你的car:你当前小时的唯一指示是仪表板上的时钟,除非你打开收音机,或者用手机联系外部时间提供商。
You can't. Unless you have a connection to an external time source - such as the internet - the only time source you have is the system clock.

Think of it like being in your car: the only indication you have of the current hour is the clock on the dash, unless you turn on the radio, or use your phone to contact an external time provider.


你的意思是UTC日期和时间时间而非本地系统日期&时间?

Do you mean UTC date & time and not local system date & time?
var UtcDateTiem = DateTime.UtcNow;


这篇关于如何在没有互联网连接的情况下获得全球日期和时间(非系统日期和时间)(使用C#进行winnforms)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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