DOW is 0-based?

Started by Igal @ Lucee.orgabout 8 years ago3 messagesgeneral
Jump to latest
#1Igal @ Lucee.org
igal@lucee.org

Is there a rational reason why Day of the Week is 0-based, i.e. Sunday
(0) to Saturday (6) instead of the more intuitive Sunday (1) to Saturday
(7)?

    SELECT date_part('dow', current_date);

https://www.postgresql.org/docs/current/static/functions-datetime.html

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/&gt;

#2Igor Korot
ikorot01@gmail.com
In reply to: Igal @ Lucee.org (#1)
Re: DOW is 0-based?

Hi,

On Thu, Feb 8, 2018 at 2:24 PM, Igal @ Lucee.org <igal@lucee.org> wrote:

Is there a rational reason why Day of the Week is 0-based, i.e. Sunday (0)
to Saturday (6) instead of the more intuitive Sunday (1) to Saturday (7)?

SELECT date_part('dow', current_date);

https://www.postgresql.org/docs/current/static/functions-datetime.html

https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week

Thank you.

Show quoted text

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org

#3Thomas Kellerer
spam_eater@gmx.net
In reply to: Igal @ Lucee.org (#1)
Re: DOW is 0-based?

Igal @ Lucee.org schrieb am 08.02.2018 um 21:24:

Is there a rational reason why Day of the Week is 0-based, i.e. Sunday (0) to Saturday (6) instead of the more intuitive Sunday (1) to Saturday (7)?

Actually, the more intuitive (in this part of the world) would be: Monday = 1, Sunday = 7 ;)

Thomas