This site is supported by donations to The OEIS Foundation.

Template talk:To day of CE

From OeisWiki
Jump to: navigation, search

Discrepancy with MySQL function FROM_DAYS(number)

With MySQL, the Days Since 1 A.D. functions give[1]


TO_DAYS(date) returns the number of days since the first day in the year 1 A.D. (there was no year 0).

The opposite effect is obtained by using FROM_DAYS(number).

mysql>
mysql> select TO_DAYS('2000-01-01') ;
+-----------------------+
| TO_DAYS('2000-01-01') |
+-----------------------+
|                730485 |               
+-----------------------+
1 row in set (0.00 sec)

mysql>
mysql>
mysql> SELECT FROM_DAYS(1000000);
+--------------------+
| FROM_DAYS(1000000) |
+--------------------+
| 2737-11-28         |      
+--------------------+
1 row in set (0.02 sec)

mysql>

compared to

  • {{day of CE|year=2000|month=01|monthday=01}} gives Expression error: Unexpected < operator. (too low by 364, why?)
  • {{day of CE|year=2737|month=11|monthday=28}} gives Expression error: Unexpected < operator. (too low by 364, why?)

Note that

The UNIX command cal incorrectly lists 4 AD as a leap year (Vardi 1991);) (Cf. {{ifleapyear}})

It looks as if MySQL considers there was a year 0, and also considers the number of complete days prior to the current day ({{day of CE}} considers the number of days up to the current day, i.e. the ordinal number of the current day) — Daniel Forgues 02:48, 12 August 2011 (UTC)

Notes