The date objects are quite flexible and designed to model dates, times and precision and its parser designed to handle most of the non-ambiguous date strings passed to it. The input parser accepts ISO8601, a large number of date formats commonly in use (including those in a number of languages) and a number of special reserved terms for dates such as "Today", "Now", "Yesterday", "Last Week", "Past Month", "14 days ago" etc. Inputs such as 2/10/2010 are ambiguous and should they be desired added as local formats (See next paragraph).
Relative dates controlled vocabulary
Today -- the LOCAL date (of the server) without time (day precision).
Yester[day|week|month|year] -- the past X (X precision) from the point of view of the local date/time where X is one of day, week, month or year (e.g. Yesterday is the day before today in day precision)
Tomorrow -- the day after today (day precision)
"This day" := Today
"This Month" -- the current month (LOCAL) in month precision
"This year" -- the current year (LOCAL) in year precision.
Now or Present -- the date/time at the moment the word is parsed.
[Last|Past] [NNN] Sec[onds]|Min[utes]|H[ours]|Day[s]|Week[s]|Month[s]|Year[s]|Decade[s]|Millennium [Ago|Past]
Last|Past&nsp;Sun[day]|Mon[day]|Tue[sday]|Wed[nesday]|Thu[rsday]|Fri[day]|Sat[urday]
Examples: "
14 hours ago", "
6 days past", "
Last year", "
Past month", "
200 minutes ago", "
Last Monday"
Note: "Yesterday" is date precision while "Past Day" is date/time precision. The two also might refer to two different days due to the time difference between local time (from the perspective of the server) and UTC/GMT: "Past Day" is based upon the date/time as per UTC/GMT while Today, Yesterday and Tomorrow are based upon "local" time.
Note also that "14 days ago" defines a date as well as method of comparison based upon day precision---thus something different from 335 hours ago or 2 weeks ago. Last year, resp. month etc., each define a precision of year, resp. month etc.
The prefix "End of" is interpreted as the end of the period.
The sequel in date ranges:
NNNNs (as in "1950s")
NNNN century (as in "19th century", "19 Jh." etc)
Past|Last [NNN] Seconds|Minutes|Hours|Days|Weeks|Months|Years|Decades|Millennium
Last|Past Sun[day]|Mon[day]|Tue[sday]|Wed[nesday]|Thu[rsday]|Fri[day]|Sat[urday]
Examples: "Past 14 days", "Past 24 hours", "Past month", "Since last Friday"
NOTE: The prefix words "Within", "during" and "the" are skipped, e.g. "Within the past day" is reduced to "Past day".
Since means from then until now. Since last week means from the start of last week to now. "Last week, by contrast, means only the days of last week (Sunday through Sat.).
Date ranges, in contrast to dates, are precise to time but start at the beginning and end at the end of their respective unit, e.g. last month starts at midnight of the first and ends just as midnight strikes on the last day of the month (in Oct. its the 31th day).
Local Extensions to handle "ambiguous" national formats
A number of local formats can be easily added via a "datemsk.ini" file. That file is quite simple and uses host-platform STRPTIME(3) function.