Main menu:

Site search

Categories

Tags

intern

Oracle und SQL

Perl

Migration Julianischer zu Gregorianischer Kalender

Migration Julianischer zu Gregorianischer Kalender

mysql


select adddate('1582-10-04', interval 1 day);
| adddate('1582-10-04', interval 1 day) |
| 1582-10-05 |
FAIL!

php


$date = new DateTime('1582-10-04');
$interval = $date->add(new DateInterval('P01D'));
echo $interval->format('Y-m-d');
1582-10-05
FAIL!

python


>>> import datetime
>>> e = datetime.date(1582, 10, 4)
>>> delta = datetime.timedelta(days=1)
>>> print e+delta
1582-10-05
FAIL!!!

postgres


postgres=# select to_char(to_date('15821004', 'YYYYMMDD') + 1, 'DD.MM.YYYY');
to_char ------------
05.10.1582 (1 row)
FAIL!

perl


perl -MDateTime -le 'print DateTime->new(year => 1582, month => 10, day => 4)->add(days => 1)'
1582-10-05T00:00:00
FAIL!

oracle


SQL> select to_char( to_date('1582104', 'yyyymmdd')+1, 'dd.mm.yyyy') from dual;
TO_CHAR(TO ----------
15.10.1582
GOOD!

R


> dtj <- strptime(c("5.10.1582"), format = "%d.%m.%Y"); > dtj + 86400
[1] "1582-10-06 CET"

Write a comment