我怎么知道我的网站主机的时区

时间:2022-11-29 23:30:34

I know this one is the weirdest of all weird questions I have asked till date. But I have a reason.

我知道这是我迄今为止所提出的所有奇怪问题中最奇怪的问题。但我有理由。

The problem is that I have a no of websites hosted in diff servers (I dont own these servers) and every website has some pages where I have to enter some execution date and time. The date/time I enter should be of the timezone in which my website's host server is running.

问题是我没有在diff服务器上托管的网站(我没有这些服务器),每个网站都有一些页面,我必须输入一些执行日期和时间。我输入的日期/时间应该是我的网站主机服务器运行的时区。

Just want to know if there is any good utility/website which can tell me the timezone/location of my web host if I provide the web site address.

只是想知道是否有任何好的实用程序/网站可以告诉我我的网站主机的时区/位置,如果我提供网站地址。

3 个解决方案

#1


You can put on each of those servers your own "system" page that will display the current time.

您可以在每个服务器上放置您自己的“系统”页面,该页面将显示当前时间。

<%= DateTime.Now.ToString() %>

And you will access it like: http://site-no-x.com/timecheck

您将访问它:http://site-no-x.com/timecheck

Something like this. Simple and effective.

像这样的东西。简单有效。

ADDED: Keep in mind also that web servers and database servers can also have different time settings. If a hosting company (theoretically) keeps the web server farm on East coast and has the database servers on West coast, you will see different dates returned by .NET's DateTime.Now and SQL's GETDATE().

增加:请记住,Web服务器和数据库服务器也可以有不同的时间设置。如果托管公司(理论上)将Web服务器场保留在东海岸并且在西海岸有数据库服务器,您将看到.NET的DateTime.Now和SQL的GETDATE()返回的不同日期。

#2


This isn't likely to be possible, as timezones are set at the OS level. (i.e.: You'd need to check programatically on each server itself using your language of choice.)

这是不太可能的,因为时区设置在操作系统级别。 (即:您需要使用您选择的语言以编程方式检查每台服务器本身。)

As such, it might be easier in the long to fix the scripts.

因此,长期修复脚本可能会更容易。

#3


So you can't modify the code to have the thing use UTC?

所以你不能修改代码让事情使用UTC?

#1


You can put on each of those servers your own "system" page that will display the current time.

您可以在每个服务器上放置您自己的“系统”页面,该页面将显示当前时间。

<%= DateTime.Now.ToString() %>

And you will access it like: http://site-no-x.com/timecheck

您将访问它:http://site-no-x.com/timecheck

Something like this. Simple and effective.

像这样的东西。简单有效。

ADDED: Keep in mind also that web servers and database servers can also have different time settings. If a hosting company (theoretically) keeps the web server farm on East coast and has the database servers on West coast, you will see different dates returned by .NET's DateTime.Now and SQL's GETDATE().

增加:请记住,Web服务器和数据库服务器也可以有不同的时间设置。如果托管公司(理论上)将Web服务器场保留在东海岸并且在西海岸有数据库服务器,您将看到.NET的DateTime.Now和SQL的GETDATE()返回的不同日期。

#2


This isn't likely to be possible, as timezones are set at the OS level. (i.e.: You'd need to check programatically on each server itself using your language of choice.)

这是不太可能的,因为时区设置在操作系统级别。 (即:您需要使用您选择的语言以编程方式检查每台服务器本身。)

As such, it might be easier in the long to fix the scripts.

因此,长期修复脚本可能会更容易。

#3


So you can't modify the code to have the thing use UTC?

所以你不能修改代码让事情使用UTC?