|
Re: Adding new column types: msg#00029lang.perl.modules.dbi.rose-db-object
On 1/11/06, John Siracusa <siracusa-mn4gwa5WIIQysxA8WJXlww@xxxxxxxxxxxxxxxx> wrote: > I had Pg time types in a few early versions of RDBO, but I could never > decide on a nice client-side representation. An integer seems like a > strange choice to me. DateTime objects aren't really appropriate because > time columns have no date information. I could just make one myself, I > suppose. What I'm looking for is pretty simple: This is a very old thread that I am resurecting, but I have recently needed to use postgres time columns in my app, and wondered if anyone has pursued this since this discussion? > * Stringifies to an arbitrary strftime-like format (HH:MM:SS by default) > * Has hour, minute, second, nanosecond, am/pm get/set methods. > * Supports simple time math with wrap-around. > > Is such a thing lurking on CPAN anywhere? Remember, no dates! :) I just noticed there is a new module on CPAN that comes close to these requirements called Time::Simple: http://search.cpan.org/~lgoddard/Time-Simple-0.04/lib/Time/Simple.pm It doesn't have am/pm accessors, but can output am/pm through strftime compatible format strings. It also doesn't have nanosecond support. It is not a perfect match to your requirements, but it does come close, so it has potential. Cheers, Cees
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: use sql functions in inserts and selects, John Siracusa |
|---|---|
| Next by Date: | Re: Adding new column types, John Siracusa |
| Previous by Thread: | ANNOUNCE: Rose::DB::Object 0.73 released, John Siracusa |
| Next by Thread: | Re: Adding new column types, John Siracusa |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |