Subject | Date Conversions and Arithmetic |
---|---|
Author | Jim Starkey |
Post date | 2001-10-29T23:55:07Z |
I've just implemented a cute hack: the manefest constants
"thismonth", "thisyear", and "thisday" in date string.
The conversion code recognizes things of the forms:
thismonth [+/- <number>]
thisyear [+/- <number>]
thisday [+/- <number>]
in date strings where a month, year, or day could otherwise be
used.
"thismonth 1" is the first of this month
"thismonth+1 0" is the last of this month
"thismonth thisday+7" is next week
"thismonth 0" is the last day of last month
"thismonth+2 25" is Chrismas (if you read this in Oct.)
"thismonth" is the last day of last month (think about it)
obvious the normal validation checking is turned off -- month,
yea years, rollover as required.
Ann is lobbying for "thisquarter" as well. The jury is still out
on that one.
Thoughts? Comments? Love it? Hate it?
Jim Starkey
"thismonth", "thisyear", and "thisday" in date string.
The conversion code recognizes things of the forms:
thismonth [+/- <number>]
thisyear [+/- <number>]
thisday [+/- <number>]
in date strings where a month, year, or day could otherwise be
used.
"thismonth 1" is the first of this month
"thismonth+1 0" is the last of this month
"thismonth thisday+7" is next week
"thismonth 0" is the last day of last month
"thismonth+2 25" is Chrismas (if you read this in Oct.)
"thismonth" is the last day of last month (think about it)
obvious the normal validation checking is turned off -- month,
yea years, rollover as required.
Ann is lobbying for "thisquarter" as well. The jury is still out
on that one.
Thoughts? Comments? Love it? Hate it?
Jim Starkey