Re: Find all the dates in the calendar week?

From: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Andrew Snow <als(at)fl(dot)net(dot)au>, Stephane Bortzmeyer <bortzmeyer(at)pasteur(dot)fr>, "Pgsql-General(at)Postgresql(dot) Org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Find all the dates in the calendar week?
Date: 2000-07-06 16:06:27
Message-ID: Pine.LNX.3.96.1000706175758.15348A-100000@ara.zf.jcu.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Thu, 6 Jul 2000, Thomas Lockhart wrote:

> > yes, my current to_char() is almost compatible with oracle, but I need
> > last two features --- IYYY (ISO-year) and IW (ISO-week). But I not explore
> > it exactly yet. I mean that current (PG's) week-of-year is like ISO or not?
>
> Yes. 'week' is "ISO week" (new for 7.0 afaicr). And it wasn't *entirely*
> trivial to implement, so you may want to steal code for to_char() ;)

My problem is not convert some data to char (in to_char()), but vice
versa convert from char to timestamp. For example convert week-of-year
number to real date. But yes, I steal you :-)

> I just didn't implement the corresponding "year" code at least partly
> because I wasn't sure what to call it. 'iyear' seems like a pretty good
> choice, or should it be 'isoyear'? 'year' is already used, obviously,
> and if 'iyear' is chosen then perhaps I should change 'week' to 'iweek'
> for consistancy. Comments?

For to_char() it is unambiguous, IW and IYYY.

BTW --- I now planning for 7.2 some routine for measure unit conversion. For
example 'km' to 'mile' ...etc. It will very good for PG international
domination :-)

Karel

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-07-06 16:13:22 Re: responses to licensing discussion
Previous Message The Hermit Hacker 2000-07-06 16:02:46 Re: PostgreSQL & the BSD License