如何根据服务器日期时间设置本地机器日期时间 [英] How Do I Set Local Machine Date Time According To Server Date Time

查看:159
本文介绍了如何根据服务器日期时间设置本地机器日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的c#windows应用程序中获取服务器日期时间,并根据服务器日期时间设置本地机器日期时间。



请帮帮我.. ..



i有获取服务器日期时间但无法将此服务器日期时间设置为本地机器日期时间...即我的机器日期时间

i want to fetch server date time form my c# windows application and set the local machine date time according to the server date time.

please help me....

i have fetch server datetime but unable to set this server datetime to local machine date time... i.e my machine datetime

推荐答案

不要。

一般来说,这是一个糟糕的主意,因为你不知道服务器设置的时区 - 如果它不相同作为你的应用程序运行的PC,你将开始真正讨厌的人...系统设置的任何变化(时间就是其中之一)需要非常仔细地考虑,因为如果你这样做,无论如何,人们将停止使用你的应用程序,并开始要求退款 - 我当然会。



但如果你绝对肯定,那么: MSDN [ ^ ]可以提供帮助。
Don't.
Generally speaking, it's a poor idea, because you have no idea what time zone the server is set to - and if it isn't the same as the PC your app runs on, you are going to start really annoying people... Any changes to system settings (and the time is one of those) needs to be very carefully considered, because if you do it willy-nilly, people will stop using your app and start demanding money back - I certainly would.

But if you are absolutely sure, then: MSDN[^] can help.


这篇关于如何根据服务器日期时间设置本地机器日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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