Re: skip weekends: revisited

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: Jeff Amiel <jamiel(at)istreamimaging(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: skip weekends: revisited
Date: 2005-03-14 14:44:25
Message-ID: 4235A349.4000105@shemesh.biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message FERREIRA William (COFRAMI) 2005-03-14 15:17:05 Re: Convert Cursor to array
Previous Message Michael Fuhr 2005-03-14 14:29:37 Re: plpython function problem workaround