Re: Date difference in seconds - Mailing list pgsql-general

From Tom Lane
Subject Re: Date difference in seconds
Date
Msg-id 28779.982951486@sss.pgh.pa.us
Whole thread Raw
In response to Date difference in seconds  ("Raghunath T" <raghunatht@mindtree.com>)
List pgsql-general
"Raghunath T" <raghunatht@mindtree.com> writes:
> Now I want the difference between start time and end time in seconds.
>         Select date_part('seconds',start_time - end_time) from temp;  gives
> me only the difference between the seconds value in both timestamps. It
> ignores all the days, hrs, minutes etc.

Try  "date_part('epoch',start_time - end_time)".  See
http://www.postgresql.org/devel-corner/docs/postgres/functions-datetime.html

            regards, tom lane

pgsql-general by date:

Previous
From: "Sergio A. Kessler"
Date:
Subject: pgPICK or sePICK
Next
From: Wayne Ward
Date:
Subject: Still having some install problems.