时区的当前时间 [英] Current Time of Timezone

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

问题描述

我型动物时区和他GMT和DST。例如:

  TimeZoneId GMT偏移1. 2010年1月DST偏移量1. 2010年7月
美洲/埃达克-10.0 -9.0
美洲/安克雷奇-9.0 -8.0
美洲/安圭拉-4.0 -4.0
美洲/安提瓜-4.0 -4.0
美洲/阿拉瓜伊纳-3.0 -3.0

由Geoname提供该时区。



我怎么能计算出当前时间,以任何时区knowning GMT和DST?我需要为C#代码。



更​​新:要指定好,我公司提供美国/安提瓜岛,我需要在美国/安提瓜岛当前时间


< DIV CLASS =h2_lin>解决方案

  TimeZoneInfo.ConvertTimeFromUtc(数值指明MyTime,TimeZoneInfo.FindSystemTimeZoneById(东部标准时间)); 


I have differents timezones and his GMT and DST. Example:

TimeZoneId GMT offset 1. Jan 2010  DST offset 1. Jul 2010
America/Adak         -10.0          -9.0
America/Anchorage     -9.0          -8.0
America/Anguilla      -4.0          -4.0
America/Antigua       -4.0          -4.0
America/Araguaina     -3.0          -3.0

This timezones are provided by Geoname.

How can I calculate the current time for any timezone knowning GMT and DST? I need the code for C#.

Update: To specify better, I provide "America/Antigua" and I need the current time in "America/Antigua".

解决方案

TimeZoneInfo.ConvertTimeFromUtc(mytime, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"));

这篇关于时区的当前时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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