Feck!

pdcawley on 2002-03-19T08:13:25

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...


Fix in the pipeline

Matts on 2002-03-19T16:02:34

This doesn't help you much, but I definitely want to get some tuits to look into replacing Time::Piece's internal representation to using TAI, so that it can go to the year billion or whatever it goes to.

Re:Fix in the pipeline

pdcawley on 2002-03-19T19:16:14

That's great news.