pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: keith@vcsn.com
To: Karel Zak <zakkr@zf.jcu.cz>
Cc: pgsql-sql@postgresql.org
Subject: Re: Problem with Day of Week
Date: Mon, 5 Feb 2001 11:56:49 -0500 (EST)
Message-ID: <Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com> (raw)
In-Reply-To: <Pine.LNX.3.96.1010205170718.29540F-100000@ara.zf.jcu.cz>

Ok, so there is actually two standards then.  Is this documented
anywhere?  Is this is something that is going to change?  I don't want
to write and app and have things "break" during and upgrade :)

Thanks for the response.

On Mon, 5 Feb 2001, Karel Zak wrote:

> 
> On Mon, 29 Jan 2001, Keith Perry wrote:
> 
> > Greetings,
> > 
> > I notice some talk about date problems and interestingly enough planning
> > out an application in which I will need to be able to manipulate dates.
> > I notice however that there seems to be a discrepancy with the day or
> > week in 7.0.3
> > 
> > ---
> > 
> > pmhcc=# select date_part('dow','now'::timestamp);
> >  date_part
> > -----------
> >          1
> > (1 row)
> > 
> > pmhcc=# select to_char('now'::timestamp,'D');
> >  to_char
> > ---------
> >  2
> > (1 row)
> > 
> 
>  See:
> 
> test=# select date_part('dow','2001-02-11'::timestamp);
>  date_part
> -----------
>          0
> 
> test=# select to_char('2001-02-11'::timestamp, 'D');
>  to_char
> ---------
>  1
>  
>  
>  date_part is based on zero - use range 0-6
>  to_char is based on one - use range 1-7
> 
> 		Karel
> 




view thread (8+ messages)  latest in thread

Message-ID: <Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com>
Permalink:  ../Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: keith@vcsn.com, zakkr@zf.jcu.cz
  Subject: Re: Problem with Day of Week
  In-Reply-To: <Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com>
  References: <Pine.LNX.3.96.1010205170718.29540F-100000@ara.zf.jcu.cz> <Pine.LNX.4.21.0102051154370.15929-100000@rah.vcsn.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox