I'd like to know if there are any libraries (preferably DateTime-esque) that can take a normal date time and create an appropriate relative human readable date. Essentially the exact opposite of the more common question: How can I parse relative dates with Perl?.
Obviously, the exact wording/interpretation is up to the actual implementation, but I'm looking to provide a consistent way to specify dates in the future. Knowing an apporximation like "due in 2 weeks
" is (to me) more helpful in getting a grasp of how much time I have remaining than something "due on 2009-07-30
".
Examples:
2009-07-06 => "in 1 year"
2009-07-30 => "in 2 weeks"
2009-07-09 => "tomorrow"
2009-07-09 12:32 => "tomorrow at 12:32"
2009-07-12 05:43 => "monday morning"
2009-07-03 05:74 => "6 days ago"