Received: from developer.digsys.bg (man@developer.digsys.bg [192.92.129.11]) by hub.org (8.9.3/8.9.3) with ESMTP id EAA97029 for ; Fri, 17 Dec 1999 04:44:09 -0500 (EST) (envelope-from man@digsys.bg) Received: from localhost (man@localhost) by developer.digsys.bg (8.9.0/8.9.0) with ESMTP id LAA11719; Fri, 17 Dec 1999 11:43:41 +0200 (EET) X-Authentication-Warning: developer.digsys.bg: man owned process doing -bs Date: Fri, 17 Dec 1999 11:43:41 +0200 (EET) From: Margarit Nickolov To: Peter Eisentraut cc: The Hermit Hacker , pgsql-sql@postgreSQL.org Subject: Re: [SQL] adding time to a datetime field ... how? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by hub.org id EAA97129 timespan type is `` time interval '@ ' '' (try: db=>\dT), and you can convert int4 to any timespan units this way: textcat(int4_field, ' units_you_like')::timespan units can be: secs, mins, hours, days, months, years Margarit. On Fri, 17 Dec 1999, Peter Eisentraut wrote: > On 1999-12-15, Margarit Nickolov mentioned: > > > select start_time,start_time+acctsessiontime::timespan from log; > > Wow, that is really weird. I would consider it confusing behaviour at > best if an explicit cast interprets an int as seconds whereas an implicit > conversion thinks it's days. > > > -- > Peter Eisentraut Sernanders väg 10:115 > peter_e@gmx.net 75262 Uppsala > http://yi.org/peter-e/ Sweden > > >