NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Dates (Score:2)
Having to parse out dates and calculate date differences manually would be a serious PITA.
Or does SQLite have a way to do this? I haven't looked.
Re:Dates (Score:2)
I don't know about SQLite, but Perl gives me date arithmetic with Matt Sergeant's Time::Piece. I've had decent luck doing date parsing when needed with HTTP::Date.
I would just as soon DBI queries give me date values as a Time::Piece.
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re:Dates (Score:2)
For that matter, barring the troubles of parsing the user input, if SQLite doesn't do dates and I need them, I would use Time::Piece objects on the Perl side and convert them to epochtime for storage on the DB side. Conversion to and from epochtime is simple with Time::Piece, arithmetic and comparisons are simple, and output formatting is simple.
Hmmm, date parsing would seem to be the only thing Time::Piece is lacking...
J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
Re:Dates (Score:1)
Time::ParseDate adds a bit of overhead though, so I try to use strptime where I can rely on dates coming back in a specific format (like date values from a database).
-- tex
Reply to This
Parent