Re: [GENERAL] date time function

2007-06-29 Thread Michael Glaesemann
On Jun 29, 2007, at 13:17 , John D. Burger wrote: I can't anything in the docs that explain how intervals print out. They seem to show like this: > select now() - '1990-01-01'; ?column? --- 6388 days 13:06:26.3605600595 Without being anchored with a

Re: [GENERAL] date time function

2007-06-29 Thread Tom Lane
"John D. Burger" <[EMAIL PROTECTED]> writes: > Why do the first and third intervals print out differently? The underlying storage is months, days, and seconds --- "1 year" is the same as "12 months", but not the same as "365 days". IIRC plain timestamp subtraction produces an interval with days an

Re: [GENERAL] date time function

2007-06-29 Thread John D. Burger
I can't anything in the docs that explain how intervals print out. They seem to show like this: > select now() - '1990-01-01'; ?column? --- 6388 days 13:06:26.3605600595 or like this: > select now() - current_date; ?column? - 14:06:4

Re: [GENERAL] date time function

2007-06-28 Thread A. Kretschmer
am Thu, dem 28.06.2007, um 16:04:48 -0400 mailte Jasbinder Singh Bali folgendes: > Hi, > > I have a timestamp field in my talbe. > I need to check its difference in days with the current date. > > field name is time_stamp and I did it as follows: > > select age(timestamp '2000-06-28 15:39:47.2

Re: [GENERAL] date time function

2007-06-28 Thread Michael Glaesemann
On Jun 28, 2007, at 15:13 , Raymond O'Donnell wrote: Cast your result to type INTERVAL - something like this: postgres=# select (current_timestamp - timestamp '2007-05-01')::interval; interval -- 58 days 21:10:36.748 (1 row) The cast to interval is superfluous

Re: [GENERAL] date time function

2007-06-28 Thread Raymond O'Donnell
On 28/06/2007 21:04, Jasbinder Singh Bali wrote: How can i convert this result into absolute number of days. Cast your result to type INTERVAL - something like this: postgres=# select (current_timestamp - timestamp '2007-05-01')::interval; interval -- 58 days 21:1

[GENERAL] date time function

2007-06-28 Thread Jasbinder Singh Bali
Hi, I have a timestamp field in my talbe. I need to check its difference in days with the current date. field name is time_stamp and I did it as follows: select age(timestamp '2000-06-28 15:39:47.272045') it gives me something like 6 years 11 mons 29 days 08:20:12.727955 How can i convert th

Re: [GENERAL] date/time function

2005-12-01 Thread Terry Lee Tucker
rnd=# select extract(epoch from timestamp '2002-09-08 05:29:41'); date_part 1031477381 (1 row) See the date/time functions documentation. On Thursday 01 December 2005 04:07 am, Sterpu Victor saith: > I need a function that will transform from the format '2002-09-08 > 05:29:41' to s

Re: [GENERAL] date/time function

2005-12-01 Thread A. Kretschmer
am 01.12.2005, um 11:07:59 +0200 mailte Sterpu Victor folgendes: > I need a function that will transform from the format '2002-09-08 05:29:41' > to seconds since 1970. scholl=# select now(); now --- 2005-12-01 10:18:47.554236+01 (1 row) scholl=# select

[GENERAL] date/time function

2005-12-01 Thread Sterpu Victor
I need a function that will transform from the format '2002-09-08 05:29:41' to seconds since 1970. Thank you. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Date Time Function / Age

2003-08-29 Thread Bruno Wolff III
On Thu, Aug 28, 2003 at 23:09:44 +0900, Alex <[EMAIL PROTECTED]> wrote: > Hi, > is there an easy way to get the Difference between 2 dates in Days... as > an integer? > > age('date1','date2') results in x years y days or something similar. > but I would like to > have the result in number of

Re: [GENERAL] Date Time Function / Age

2003-08-28 Thread Tom Lane
Alex <[EMAIL PROTECTED]> writes: > is there an easy way to get the Difference between 2 dates in Days... as > an integer? Subtract 'em ... regression=# select '2002-01-01'::date - '2001-01-01'::date; ?column? -- 365 (1 row) regards, tom lane

[GENERAL] Date Time Function / Age

2003-08-28 Thread Alex
Hi, is there an easy way to get the Difference between 2 dates in Days... as an integer? age('date1','date2') results in x years y days or something similar. but I would like to have the result in number of days as an integer. Thanks for your help Alex ---(end of br