On 1/11/06, John Siracusa <[EMAIL PROTECTED]> 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


_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to