pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DOW is 0-based?
3+ messages / 3 participants
[nested] [flat]

* DOW is 0-based?
@ 2018-02-08 20:24  Igal @ Lucee.org <igal@lucee.org>
  0 siblings, 2 replies; 3+ messages in thread

From: Igal @ Lucee.org @ 2018-02-08 20:24 UTC (permalink / raw)
  To: pgsql-general

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/;

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: DOW is 0-based?
@ 2018-02-08 20:57  Igor Korot <ikorot01@gmail.com>
  parent: Igal @ Lucee.org <igal@lucee.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Igor Korot @ 2018-02-08 20:57 UTC (permalink / raw)
  To: Igal @ Lucee.org <igal@lucee.org>; +Cc: pgsql-general

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.

>
> Thanks,
>
> Igal Sapir
> Lucee Core Developer
> Lucee.org




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: DOW is 0-based?
@ 2018-02-09 07:23  Thomas Kellerer <spam_eater@gmx.net>
  parent: Igal @ Lucee.org <igal@lucee.org>
  1 sibling, 0 replies; 3+ messages in thread

From: Thomas Kellerer @ 2018-02-09 07:23 UTC (permalink / raw)
  To: pgsql-general

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










^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-02-09 07:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-08 20:24 DOW is 0-based? Igal @ Lucee.org <igal@lucee.org>
2018-02-08 20:57 ` Igor Korot <ikorot01@gmail.com>
2018-02-09 07:23 ` Thomas Kellerer <spam_eater@gmx.net>

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