Time measurements and units of measure. See also my section on Microsoft Time Functions and My About#Dates.
| According to the U.S. Naval Observatory Master Clock when this page is loaded: | |
|---|---|
US Central Standard Time -06:00 UTC (-05:00 during DST/summer) |
Coordinated Universal Time +06:00 CST (+05:00 during DST/summer) |
Thankfully most modern systems agree upon the second as the unit of time.
Here is the traditional set.
Here is a metric set. Note that "metric min", "metric h", "metric d", and "metric y" are hardly ever used.
See also Intro to History.
Given a date, the form below returns the date in various formats. So far my code only works for Microsoft Internet Explorer. [2004-08-17: I updated my code to work according to the W3C DOM so it works on browsers like MSIE and Mozilla.]
You may also want to see my section on Microsoft Time Functions.
ISO 8601 [1988], in my opinion, is more elegant than RFC 822. Here are the basics of ISO 8601.
DATESCalendar date. CC EG: 19 (19th century) CCYY EG: 1997 CCYY-MM EG: 1997-07 CCYY-MM-DD EG: 1997-07-16 Ordinal week of year & ordinal day of week. CCYY-WWW EG: 1997-W29 (29th week of 1997). W01 is always 1st week with a Thu. CCYY-WWW-D EG: 1997-W29-3 (3rd day of the 29th week). 1st day is always Mon. Ordinal day of year. CCYY-DDD EG: 1997-198 (198th day of 1997). Watch for leap years.
TIMES hh EG: 19 (19th hour or 7 p.m. local time) hh.h EG: 19.35 hh:mm EG: 19:21 hh:mm.m EG: 19:21.5 hh:mm:ss EG: 19:21:30 hh:mm:ss.s EG: 19:21:30.4537hh:mm:ss.sTZD EG: 19:21:30.4537+01:00 or 18:21:30.4537Z Any of the time options may have a TZD.
A date and a time may be concatenated with a t. EG: 1997-07-16t18:21:30.4537Z.
The standard has is case-insensitive for all the literal letters used. That is T, P, R, W, Y, M, D, H, and S can be substituted with t, p, r, w, y, m, d, h, and s. I prefer to use upper case M for month and lower case m for minutes. I also prefer the lower case t to the upper case T because it is easier to see visually and because a lower case t has a tradition of usage as the variable for time.
It is allowable to remove the separating hyphens and colons. EG: 19970716t192130.4537+0100 is "Basic Format" according to the standard, while 1997-07-16t19:21:30.4537+01:00 is considered "Extended Format". The Basic Format is not as human readable but it is useful programmatically and in situations where you want to save space and/or avoid those characters, especially in the case of file or directory names.
Dates and times may be truncated with an implied date portion that's signified with a single dash (-). Sufficient context is of course required. It is safer and easier to avoid implied date portions, esp. if the date may be taken out of context.
1997-07-16t18:21:30.4537Z.97-07-16 implies 1997-07-16, i.e. implied century but no truncation mark is used.-97-07 implies 1997-07, i.e. implied century.-97 implies 1997, i.e. implied century.--07-16 implies 1997-07-16, i.e. implied century & year.--07 implies 1997-07, i.e. implied century & year.---16 implies 1997-07-16, i.e. implied century, year, & month1997-W29-3.97-W29-3 implies 1997-W29-3, i.e. implied century.97-W29 implies 1997-W29, i.e. implied century.-7-W29-3 implies 1997-W29-3, i.e. implied century & decade.-7-W29 implies 1997-W29, i.e. implied century & decade.-W29-3 implies 1997-W29-3, i.e. implied century, decade, & year.-W29 implies 1997-W29, i.e. implied century, decade, & year.-W-3 implies 1997-W39-3, i.e. implied century, decade, year, & week.1997-198.97-198 implies 1997-198, i.e. implied century.-198 implies 1997-198, i.e. implied century, decade, & year.18:21:30.4537Z.-21 implies 18:21, i.e. implied hour.--30 implies 18:21:30, i.e. implied hour & minute.
BCE (or B.C.) years can be indicated with a negative sign. EG: -1500-07 is July 1500 BCE. Years of greater magnitude can also use more than 4 digits. EG: -600000 is 600,000 BCE.
The following examples indicate the same point in time (ignoring daylight savings time).
12:00Z = 13:00+01:00 = 13:00 CET (Central European Time) 12:00Z = 07:00-05:00 = 07:00 EST (Eastern Standard Time) 1995-02-04t24:00 = 1995-02-05T00:00
Periods of time or time intervals are done 4 different ways:
startTime/stopTime). EGs:1998-05-12/15 time interval within a month 1998-05-12t14:15Z/15t16:00Z time interval within a month and specific times 1998-05-12t14:15Z/16:00Z time interval within a day
Pduration. EGs:P1Y2M3Dt4h5m6s time duration of 1 year, 2 months, 3 days, 4 hours, 5 minutes, and 6 seconds P0001-02-03t04:05:06 same as above P00010203t040506 same as above P1W time duration of 1 week P0Y0M0Dt40h0m0s time duration of 40 hours P40h same as above
startTime/Pduration. EG:1998-05-12t14:15Z/P0001-01-02
Pduration/stopTime.EG:P1Y2M3D/1998-05-12t14:15Z
Recurring periods of time or recurring time intervals are expressed like the 4 ways of expressing non-repeating periods of time except that they start with R/ (to repeat forever) or Rn/ (to indicate how many times the interval repeats). EGs: These examples repeat 3 times.
R3/1998-05-12/15 R3/P1Y2M3D (R/P1Y would recur annually forever) R3/1998-05-12t14:15Z/P0001-02-03 R3/P1Y2M3D/1998-05-12t14:15Z
ISO 8601 is vastly superior for many reasons. Here are a few:
- It is human and machine readable.
- Increase machine readability by removing the special characters like "-" and ":".
- Sort ISO 8601 formatted dates without any modification.
- Databases often accept ISO 8601. EG: Microsoft SQL Server 2005 takes this format:
yyyy-mm-ddThh:mm:ss[.mmm], regardless of the SET DATEFORMAT or SET LANGUAGE settings.
RFC 822 [1982] is the original standard for ARPA Internet text message (including email). RFC 822 was updated with RFC 1123 [1989] for 4 digit years. Here are the basics of RFC 822 copied right out of the RFC.
date-time = [ day "," ] date time ; dd mm yy
; hh:mm:ss zzz
day = "Mon" / "Tue" / "Wed" / "Thu" / "Fri" / "Sat" / "Sun"
date = 1*2DIGIT month 2*4DIGIT ; day month year
; EG: 20 Jun 82
month = "Jan" / "Feb" / "Mar" / "Apr"
/ "May" / "Jun" / "Jul" / "Aug"
/ "Sep" / "Oct" / "Nov" / "Dec"
time = hour zone ; ANSI and Military
hour = 2DIGIT ":" 2DIGIT [":" 2DIGIT] ; 00:00:00 - 23:59:59
zone = "UT" / "GMT" ; Universal Time
; North American : UT
/ "EST" / "EDT" ; Eastern: - 5/ - 4
/ "CST" / "CDT" ; Central: - 6/ - 5
/ "MST" / "MDT" ; Mountain: - 7/ - 6
/ "PST" / "PDT" ; Pacific: - 8/ - 7
/ 1ALPHA ; Military: Z = UT;
; A:-1; (J not used)
; M:-12; N:+1; Y:+12
/ ( ("+" / "-") 4DIGIT ) ; Local differential
; hours+min. (HHMM)
EGs:
Mon, 25 Dec 1995 13:30:00 GMT Mon 5 Dec 95 13:30:00 Z
While RFC 822 is a nice little standard, it is not used much outside of the Internet. In contrast ISO 8601 is broadly used and is comparable to the formatting already used by the Chinese and astronomers.
Coordinated Universal Time (UTC) follows TAI (see below) exactly except for an integral number of seconds, presently 32. These leap seconds are inserted on the advice of the International Earth Rotation Service (IERS) to ensure that, on average over the years, the Sun is overhead within 0.9 seconds of 12:00:00 UTC on the meridian of Greenwich. UTC is thus the modern successor of Greenwich Mean Time, GMT, which was used when the unit of time was the mean solar day.
International Atomic Time (TAI) is calculated by the BIPM from the readings of more than 200 atomic clocks located in metrology institutes and observatories in more than 30 countries around the world. TAI is made available every month in the BIPM Circular T. We estimate that TAI does not lose or gain with respect to an imaginary perfect clock by more than about one tenth of a microsecond (0.000 000 1 second) per year.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| +East of Greenwich | A CET |
B EET |
C BT |
D | E E*India |
F | G | H CCT/Phil |
I JST |
K ACS |
L GST |
M IDLE |
|
| Greenwich | Z | ||||||||||||
| -West of Greenwich | N WAT |
O | P | Q AST |
R EST |
S CST |
T MST |
U PST |
V YST |
W AHST |
X | Y IDLW |
Links that lead to off-site pages about time, units of time, and so on.
Page Modified: (Hand noted: 2008-01-23 19:59:55Z) (Auto noted: 2008-01-23 20:58:14Z)