GMT时间而不是服务器时间 [英] GMT Time instead of Server Time

查看:222
本文介绍了GMT时间而不是服务器时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



目前,我将服务器时间作为应用程序的默认时间.现在,如果我在任何其他国家/地区启动该应用程序,则通过指定国家/地区名称,我想发回该特定国家/地区的GMT时间,而不是服务器时所在国家/地区的时间.
请任何人提供代码.




问候,
桑蒂亚(R.Santhya)

我已经尝试过,我可以通过使用区域时间来获取服务器时间和当前国家/地区的GMT时间,并且我已经尝试过,可以获取中欧时间和东欧时间.如果我想通过zoneid尝试输入特定的国家/地区名称,则无法这样做.

字符串zoneId =欧洲中部标准时间";
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(zoneId);

Hi,

Currently i''m taking Server time as default in an application. Now if i launch the application in any other country, by specifying the country name, i want to send back that particular country''s GMT time , instead of server moment country''s time.

Kindly anybody give the code.




Regards,
R.Santhya

I have already tried, that i can able to take the server time and current country GMT time by using the zone time, as well as i have tried that, i can able get Central European Time, and Eastern European Time. If i want to try for particular country name by as zoneid , i cant to do so.

string zoneId = "Central European Standard Time";
TimeZoneInfo tzi = TimeZoneInfo.FindSystemTimeZoneById(zoneId);

推荐答案

任何人都可以提供代码.
请避免这种情况!我们希望您尝试一下,做出一些努力,然后发布您遇到的问题.询问代码对任何人都无济于事! :doh:

我想发回该特定国家/地区的GMT时间,而不是服务器时刻所在国家/地区的时间.
它是一个Web应用程序.任何国家的人都将连接到其他地方的网络服务器.如果您想要格林威治标准时间的特定时间,则必须在返回时间的同时追踪国家/地区并更改响应.或使用一些ActiveX/JavaScript从客户端系统获取时间并使用它.这完全取决于您所具有的方案/需求的类型.通常,它是从客户端计算机上选择并显示的.服务器不执行任何操作.
Kindly anybody give the code.
Avoid this please! We expect you to try, make some effort and then post where you get stuck. Asking for code would not help anyone! :doh:

i want to send back that particular country''s GMT time , instead of server moment country''s time.
It''s a Web application. People from any country would be connecting to a webserver sitting somewhere else. if you want particular time GMT, you have to trace the country and make changes to the response while returning the time. Or use some ActiveX/JavaScript to get the time from the client system and use it. It would entirely depend on type of scenario/requirement you have. Generally, it''s picked from client machine and displayed. Server does not do anything.


希望我最近对类似问题的回答将帮助您理解所有这些内容:
[已解决] XML日期时间转换问题 [ ^ ].



我最近的其他答案显示了如何列出时区:
使用特定国家/地区名称的GMT时间 [
Hope my recent answer to a similar Question will help you to understand all this:
[Solved] XML Date Time Conversion Issue[^].



My other recent answers shows how to list the time zones:
GMT Time using particular country name[^].

You can generate a list of zones at the server, present it to the user and ask the user to create an account and select one of the time zones. Make it mandatory by server-side validation, don''t allow for default zone. In this way, you will be able to do time calculations depending on the account''s time zone data.

—SA


这篇关于GMT时间而不是服务器时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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