Discussion:
Help needed on time data types
(too old to reply)
mike
2004-07-12 07:53:01 UTC
Permalink
Hi I am trying to setup a timesheet app. However I have come up against
an unexpected problem (possibly fatal)

I cannot seem to find a field type in postgres that is equivalent to
h:mm without enforcing a 24 hour day limit. This seems to preclude pg
from use - am I correct?

All the date-time types seem to only be for specific time dates and not
for a running total.

Any help appreciated.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
Michal Taborsky
2004-07-12 08:22:36 UTC
Permalink
Post by mike
I cannot seem to find a field type in postgres that is equivalent to
h:mm without enforcing a 24 hour day limit. This seems to preclude pg
from use - am I correct?
You want to use "interval" data type and then do some formatting on the
output to get 123 hours 30 minutes.

See:
http://www.postgresql.org/docs/7.4/interactive/datatype-datetime.html
--
Michal Taborsky
http://www.taborsky.cz


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
Peter Eisentraut
2004-07-12 08:29:04 UTC
Permalink
Post by mike
All the date-time types seem to only be for specific time dates and
not for a running total.
You probably want the interval type.


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
Loading...