develooper Front page | perl.datetime | Postings from March 2012

Are the formats in DateTime::Format::Strptime extensible?

Thread Next
From:
David McMath
Date:
March 15, 2012 14:43
Subject:
Are the formats in DateTime::Format::Strptime extensible?
Message ID:
4F626284.9000201@stanford.edu
Dear List,

A while back, I needed to some routines to parse timestamps so I started 
using DateTime::Format::Strptime.  The times were uniformly formatted 
like "2012-03-13T07:43:07-07:00".  That /almost/ matched the pattern 
"%FT%T%z" but I couldn't figure out how to force the match.  So I ended 
up taking a shortcut and removing the final ":" before processing.

Now I want to recycle the code and handle a few more formats and I'd 
/really/ like it to be the case that I don't have to do any 
manipulations of the strings before parsing; I'd much rather just have 
the caller specify what the proper format is and go from there.

Any advice is appreciated,

dave

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About