Entering time into postgresql

Started by BlackMagealmost 17 years ago3 messagesgeneral
Jump to latest
#1BlackMage
dsd7872@uncw.edu

Is there a field that can actually store time in PostgreSql. And what I mean
by time is not like time of the day, but a specific amount of time.

The application I am developing records how long it takes for a user to do a
task, say 5 minutes and 32 seconds. That time is entered into the database
so latter it can be sorta like: "SELECT * FROM user_time WHERE
time_taken<6:00".

Thanks in advance.
--
View this message in context: http://www.nabble.com/Entering-time-into-postgresql-tp23925803p23925803.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#2David Wilson
david.t.wilson@gmail.com
In reply to: BlackMage (#1)
Re: Entering time into postgresql

On Mon, Jun 8, 2009 at 11:04 AM, BlackMage <dsd7872@uncw.edu> wrote:

Is there a field that can actually store time in PostgreSql. And what I mean
by time is not like time of the day, but a specific amount of time.

The manual is your friend:
http://www.postgresql.org/docs/8.3/static/datatype-datetime.html

The interval data type is what you're looking for.

--
- David T. Wilson
david.t.wilson@gmail.com

#3Vick Khera
vivek@khera.org
In reply to: BlackMage (#1)
Re: Entering time into postgresql

On Mon, Jun 8, 2009 at 11:04 AM, BlackMage<dsd7872@uncw.edu> wrote:

Is there a field that can actually store time in PostgreSql. And what I mean
by time is not like time of the day, but a specific amount of time.

This is known as type "INTERVAL" to postgres.