Skip site navigation (1) Skip section navigation (2)

Re: [SQL] RE: DATE Formating Problem Again

From: Karel Zak - Zakkr <zakkr(at)zf(dot)jcu(dot)cz>
To: Mark Kirkwood <markir(at)ihug(dot)co(dot)nz>
Cc: forgacs(at)negral(dot)com, pgsql-sql(at)postgreSQL(dot)org, efte(at)negral(dot)com
Subject: Re: [SQL] RE: DATE Formating Problem Again
Date: 2000-03-02 11:10:39
Message-ID: Pine.LNX.3.96.1000302120719.3304B-100000@ara.zf.jcu.cz (view raw or flat)
Thread:
Lists: pgsql-sql


On Thu, 2 Mar 2000, Mark Kirkwood wrote:

> >I am searching after the date formatting solution, but didn't found a
> >correct one.
> >
> >So example ORACLE has
> >    - to_char function to make any kind of date format from a date
> type:
> >to_char(now,'yyyy.mm.dd')
> >    - to_date to makes a date type from any kind of string: to_date
> >('1999.11.23','yyyy.mm.dd')
> >(sniped...)
> 
> I have wrestled a bit with this myself - being an Oracle dba ( but i'm
> alright now....),
> the date <-> char conversion is very different is Postgresql.
> 
> However I have found that the "date_part" and "interval" functions seem
> to do the job ok,
> sometimes combined with the casting operator  "::datetime".
> 
> e.g : ( for release 7.0 )
> date -> number

 The release 7.0 has to_char/to_date/to_timestamp functions too,
and it is very compatible with Oracle's to_char(). See the PostgreSQL
documentation for more details.

						Karel


In response to

pgsql-sql by date

Next:From: Emils KlotinsDate: 2000-03-02 15:10:07
Subject: date_part - multiple values in format?
Previous:From: Mark KirkwoodDate: 2000-03-02 09:54:54
Subject: RE: DATE Formating Problem Again

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group