Stories
Slash Boxes
Comments
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

use Perl Log In

Log In

[ Create a new account ]

pdcawley (485)

pdcawley
  (email not shown publicly)
http://www.bofh.org.uk/
AOL IM: pdcawley (Add Buddy, Send Message)

Journal of pdcawley (485)

Tuesday March 19, 2002
03:13 AM

Feck!

[ #3634 ]

So, yesterday we were working on a timetable app that you could query to find out the next bus due at a given stop. Right now we're working on loading up the timetable data (which can get surprisingly complicated; dealing with term times, bank holidays, sunday/saturday services...), and to make life easier we came up with the idea of a 'period' object which could hold the period for which a given timetable was valid.

This got implemented on top of Set::IntSpan, using Time::Piece objects for dates (which were then converted into 'days since 1/1/1970' inside the Period class).

All was going swimmingly until my pair mentioned that periods extending out to, say, 2099 were not desperately uncommon. A swift check of Time::Piece later we start looking for something that can handle dates outside the Unix era. It looks like Date::Simple is going to be our puppy. It suffers from the Y10K issue, but I think we're safe from that for now.

And on closer inspection, it looks like it fits our needs better anyway, no silly worrying about seconds.

Thank heavens for abstration. It's going to be almost trivial to replace Time::Piece with Date::Simple. Just a shame we didn't realise before we did the Time::Piece work...

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.