Re: skip weekends: revisited - Mailing list pgsql-general

From Shachar Shemesh
Subject Re: skip weekends: revisited
Date
Msg-id 4235A349.4000105@shemesh.biz
Whole thread Raw
In response to skip weekends: revisited  (Jeff Amiel <jamiel@istreamimaging.com>)
List pgsql-general
Jeff Amiel wrote:

> Back in 2002, Jean-Luc Lachance gave a nifty algorithm
> (http://archives.postgresql.org/pgsql-sql/2002-06/msg00301.php) for
> determining the resulting date given a starting date and number of
> 'workdays' in the future.  The trick was that weekends (Saturday and
> Sunday) could not be counted.

...

> What am I doing/interpreting wrong?

I'm not sure about the algorithm. I can tell you, however, that such an
algorithm is locale dependent.

For example, in Israel the work week is Sunday-Thursday. Weekend is
Friday and Saturday. I'm fairly sure that there are places around the
globe in which a work-week is six days long.

          Shachar

--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
Have you backed up today's work? http://www.lingnu.com/backup.html


pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: plpython function problem workaround
Next
From: "FERREIRA William (COFRAMI)"
Date:
Subject: Re: Convert Cursor to array