量化标准:UTC,GMT,PST时间解释

来源:百度文库 编辑:九乡新闻网 时间:2024/10/06 01:31:46
UTC,GMT,PST时间解释2010-01-07 12:53整个地球分为二十四时区,每个时区都有自己的本地时间。在国际无线电通信场合,为了统一起见,使用一个统一的时间,称为通用协调时(UTC, Universal Time Coordinated)。UTC与格林尼治平均时(GMT, Greenwich Mean Time)一样,都与英国伦敦的本地时相同。在本文中,UTC与GMT含义完全相同。
北京时区是东八区,领先UTC八个小时,在电子邮件信头的Date域记为+0800。如果在电子邮件的信头中有这么一行:
Date: Fri, 08 Nov 2002 09:42:22 +0800
说明信件的发送地的地方时间是二○○二年十一月八号,星期五,早上九点四十二分(二十二秒),这个地方的本地时领先UTC八个小时(+0800,就是东八区时间)。电子邮件信头的Date域使用二十四小时的时钟,而不使用AM和PM来标记上下午。
以这个电子邮件的发送时间为例,如果要把这个时间转化为UTC,可以使用一下公式:
UTC + 时区差 = 本地时间
时区差东为正,西为负。在此,把东八区时区差记为 +0800,
UTC + (+0800) = 本地(北京)时间 (1)
那么,UTC = 本地时间(北京时间))- 0800 (2)
0942 - 0800 = 0142
即UTC是当天凌晨一点四十二分二十二秒。如果结果是负数就意味着是UTC前一天,把这个负数加上2400就是UTC在前一天的时间。例如,本地(北京)时间是 0432 (凌晨四点三十二分),那么,UTC就是 0432 - 0800 = -0368,负号意味着是前一天, -0368 + 2400 = 2032,既前一天的晚上八点三十二分。
纽约的时区是西五区,比UTC落后五个小时,记为 -0500:
UTC + (-0500) = 纽约时间 (3)
UTC = 纽约时间 + 0500 (4)
把(2)式 - (4)式相比较,
UTC = 北京时间 - 0800 = 纽约时间 + 0500 (5)
即 北京时间 = 纽约时间 + 1300 (6)
即北京时间领先纽约时间十三个小时,由(6)式,
纽约时间 = 北京时间 - 1300 (7)
在四月下旬,纽约又换用夏令时,又称为日光节约时,比标准纽约时间提前一个小时,实际成为西四区的标准时间,成为 -0400。
UTC + (-0400) = 纽约夏令时,套用以上公式,
北京时间 = 纽约夏令时 + 1200
纽约夏令时 = 北京时间 - 1200
在这些转换中,最重要的公式就是
UTC + 时区差 = 本地时间
时区差东为正,西为负。例如,东八区(北京)是 +0800,西五区(纽约)是-0500,加州是西八区,是-0800,美国中部时区是西六区,-0600,美国山地时区是西七区,-0700,太平洋时区是西八区,-0800,在夏天使用夏时制,成为-0700。德国时区是东一区,+0100,夏天变为+0200。
多数电子邮件程序,例如Outlook Express,在显示时间时,计算机程序把时间先转换成为本地时间再显示,例如,邮件的Date域为:
Date: Fri, 08 Nov 2002 09:42:22 +0800
Outlook Express在显示时就显示为:
Date: Thur, 07 Nov 2002 08:42:22 pm,把北京时间转换成为了纽约时间,而且把二十四小时格式的时间转换成为了十二小时的格式。当然,为了时间转换正确,发送方和接受方的计算机的时区都要设置正确,在这里,发送方的时区要正确地设为北京时区东八区,而我的时区要设为西五区。
为了方便起见,我在这里放上纽约,加洲以及北京实时显示的时钟,以省去计算的麻烦。
==================
Internet标准时间格式说明==================Wednesday, 30. August 2006, 08:35:40
RFC3339, RFC2822, ISO8601语法定义:
date-fullyear = 4DIGITdate-month = 2DIGIT ; 01-12date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on; month/yeartime-hour = 2DIGIT ; 00-23time-minute = 2DIGIT ; 00-59time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second; rulestime-secfrac = " ." 1*DIGITtime-numoffset = (" +" / " -" ) time-hour " :" time-minutetime-offset = " Z" / time-numoffset
partial-time = time-hour " :" time-minute " :" time-second[time-secfrac]full-date = date-fullyear " -" date-month " -" date-mdayfull-time = partial-time time-offset
date-time = full-date " T" full-time



限制:
一年中月份的最大天数
Month Number Month/Year Maximum value of date-mday------------ ---------- --------------------------01 January 3102 February, normal 2802 February, leap year 2903 March 3104 April 3005 May 3106 June 3007 July 3108 August 3109 September 3010 October 3111 November 3012 December 31



时区:
三个字符表示美国部分时区. 第一种字符 " E" , " C" , " M" , or " P" 对应 " Eastern" ," Central" ," Mountain" 和 " Pacific" . 第二种字符如 " S" 对应" Standard" 时间, 或者 " D" 对应 " Daylight" (or summer) 时间(夏令时).列表如下:
EDT is 相等于 -0400EST is 相等于 -0500CDT is 相等于 -0500CST is 相等于 -0600MDT is 相等于 -0600MST is 相等于 -0700PDT is 相等于 -0700PST is 相等于 -0800
用一个字符定义时区在RFC822中不大标准,在此定义如下:
RFC2822中定义:字母A至I 代表+0100到+0900字母k至M 代表+1000到+1200字母N至Y 代表-100到-1200字母z 代表+0000
在RFC822中定义:月份:month = " Jan" / " Feb" / " Mar" / " Apr" / " May" / " Jun" / " Jul" / " Aug" / " Sep" / " Oct" / " Nov" / " Dec" 日期:day = " Mon" / " Tue" / " Wed" / " Thu" / " Fri" / " Sat" / " Sun" 


Internet标准时间格式例子:


1985-04-12T23:20:50.52Z
This represents 20 minutes and 50.52 seconds after the 23rd hour ofApril 12th, 1985 in UTC.
1996-12-19T16:39:57-08:00
This represents 39 minutes and 57 seconds after the 16th hour ofDecember 19th, 1996 with an offset of -08:00 from UTC (PacificStandard Time). Note that this is equivalent to 1996-12-20T00:39:57Zin UTC.
1990-12-31T23:59:60Z
This represents the leap second inserted at the end of 1990.
1990-12-31T15:59:60-08:00
This represents the same leap second in Pacific Standard Time, 8hours behind UTC.
1937-01-01T12:00:27.87+00:20
This represents the same instant of time as noon, January 1, 1937,Netherlands time. Standard time in the Netherlands was exactly 19minutes and 32.13 seconds ahead of UTC by law from 1909-05-01 through1937-06-30. This time zone cannot be represented exactly using theHH:MM format, and this timestamp uses the closest representable UTCoffset.


RFC 3339标准时间示例:
2002-10-02T10:00:00-05:00
2002-10-02T15:00:00Z
2002-10-02T15:00:00.05Z


RFC-822标准时间示例:
< pubDate> Wed, 02 Oct 2002 08:00:00 EST< /pubDate> 
< pubDate> Wed, 02 Oct 2002 13:00:00 GMT< /pubDate> 
< pubDate> Wed, 02 Oct 2002 15:00:00 +0200< /pubDate>
=============
PST时间
=============
PST,即太平洋标准时间,此时区位于格林威治向西8个时区。
转自:http://blog.myspace.cn/e/403548846.htm