关于Godaddy托管服务器的时间 [英] About time of godaddy Hosting server
问题描述
大家好
在我的应用程序中,很多地方都使用datetime.now.但是,如果按时托管,则比印度的时间少30分钟.
如何解决这个问题
我想在印度显示与戈达迪同时显示的应用程序.什么代码可以解决此问题
在此先感谢
Amrutha
Hi all
In my application many places i used datetime.now. But when it is hosted in time shows 30 minutes less than india''s time.
How to solve this problem
I want application in godaddy shown the same time as indias .what code will solve this problem
Thanks in Advance
Amrutha
推荐答案
而不是使用
Instead of using
datetime.now
我建议使用
I would recommend using
dim cur_time = datetime.UtcNow
这将为您提供以世界标准时间表示的时间.然后,您可以执行以下操作:
This will give you the time expressed as the Universal Coordinated Time. Then, you can do something like:
cur_time = cur_time.AddHours(-8)
当然,您可以更改"-8"以匹配所需的任何时区.以下是按时区列出的时差列表:
http://en.wikipedia.org/wiki/List_of_time_zones_by_UTC_offset
Of course, you would change the "-8" to match whatever timezone you want. Here''s a list of the hour differences by timezone:
http://en.wikipedia.org/wiki/List_of_time_zones_by_UTC_offset
这篇关于关于Godaddy托管服务器的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!