A time of day item in date strings specifies the time on a given day. Here are some examples, all of which represent the same time:
20:02:0 20:02 8:02pm 20:02-0500 # In EST (Eastern U.S. Standard Time).
More generally, the time of the day may be given as `hour:minute:second', where hour is a number between 0 and 23, minute is a number between 0 and 59, and second is a number between 0 and 59. Alternatively, `:second' can be omitted, in which case it is taken to be zero.
If the time is followed by `am' or `pm' (or `a.m.' or `p.m.'), hour is restricted to run from 1 to 12, and `:minute' may be omitted (taken to be zero). `am' indicates the first half of the day, `pm' indicates the second half of the day. In this notation, 12 is the predecessor of 1: midnight is `12am' while noon is `12pm'.
The time may alternatively be followed by a timezone correction, expressed as `shhmm', where s is `+' or `-', hh is a number of zone hours and mm is a number of zone minutes. When a timezone correction is given this way, it forces interpretation of the time in UTC, overriding any previous specification for the timezone or the local timezone. The minute part of the time of the day may not be elided when a timezone correction is used. This is the only way to specify a timezone correction by fractional parts of an hour.
Either `am'/`pm' or a timezone correction may be specified, but not both.
Go to the first, previous, next, last section, table of contents.