It seems unusual that "next June" and "last June" both pick the 4th of the month (today's date); but just "June" gives the 1st of the month.
Also "next June" gives "Friday, June 04, 2010 12:00:00 AM" so it picks the day of the month based on today; but the time of day doesn't depend on the time now.
(pseudo) Date d = new Date('1/31/2009'); d.addOneMonth();
What is the value of d? 2/28/09? 3/2/09? 2/25/09?
Writing a date library is not for the fainthearted.
This is a major personal hobby-horse of mine, and I don't know of a library that does all of what I want by default. The constructor for datetime in Python's standard library comes very close:
datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
All of the time components have no implied precision beyond the input you've given -- "2009-06-04 3pm" is never implicitly upcast into "2009-06-04 15:00:00 UTC". This is awesome.Unfortunately the date object used internally does not allow for partial precision, so datetime doesn't expose it.