Front page | perl.datetime |
Postings from January 2003
From: John Peacock
January 14, 2003 06:58
Message ID: 3E242490.email@example.com
Are these going to be permissible initialization calls with the proposed API?
my $dt1 = new DateTime "Yesterday";
my $dt2 = new DateTime "2002/01/04";
my $dt3 = new DateTime "1-4-2002"; # same as last, i.e U.S. parsing
my $dt4 = new DateTime localtime();
my $dt4 = new DateTime "11:30pm";
The reason I ask is that a lot of the example init's seem to assume the
date/time has already been parsed into it's constituents. I would like to have
those too, but for most purposes, the module should DWIM.
I would propose that DateTime itself should have no parsing itself, rather it
should always call DateTime::Parse, which would itself be a set of replaceable
routines with various possible backends, e.g DateTime::Parse::MySQL. The
default implementation should handle most/all of the above without any other module.
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
by John Peacock