The
parsedate() function parses a datetime from
datestr described in english relative to an optional
time point and an optional timezone offset in seconds specified in
tzoff. If either
time or
tzoff are
NULL, then the current time and timezone offset are used.
The
datestr is a sequence of white-space separated items. The white-space is optional the concatenated items are not ambiguous. An empty
datestr is equivalent to midnight today (the beginning of this day).
The following words have the indicated numeric meanings:
last = -1,
this = 0,
first or next 1,
second is unused so that it is not confused with “seconds”,
third = 3,
fourth = 4,
fifth = 5,
sixth = 6,
seventh = 7,
eighth = 8,
ninth = 9,
tenth = 10,
eleventh = 11,
twelfth = 12.
The following words are recognized in English only:
AM,
PM,
a.m.,
p.m.
The months:
january,
february,
march,
april,
may,
june,
july,
august,
september,
sept,
october,
november,
december,
The days of the week:
sunday,
monday,
tuesday,
tues,
wednesday,
wednes,
thursday,
thur,
thurs,
friday,
saturday.
Time units:
year,
month,
fortnight,
week,
day,
hour,
minute,
min,
second,
sec,
tomorrow,
yesterday.
Timezone names:
gmt,
ut,
utc,
wet,
bst,
wat,
at,
ast,
adt,
est,
edt,
cst,
cdt,
mst,
mdt,
pst,
pdt,
yst,
ydt,
hst,
hdt,
cat,
ahst,
nt,
idlw,
cet,
met,
mewt,
mest,
swt,
sst,
fwt,
fst,
eet,
bt,
zp4,
zp5,
zp6,
wast,
wadt,
cct,
jst,
east,
eadt,
gst,
nzt,
nzst,
nzdt,
idle.
A variety of unambiguous dates are recognized:
69-09-10
For years between 69-99 we assume 1900+ and for years between 0-68 we assume 2000+.
2006-11-17
An ISO-8601 date.
10/1/2000
October 10, 2000; the common US format.
1-sep-06
Other common abbreviations.
1/11
the year can be omitted
As well as times:
Relative items are also supported:
Seconds since epoch (also known as UNIX time) are also supported:
@735275209
Tue Apr 20 03:06:49 UTC 1993