On Thu, 30 Sep 2021, Sven Schreiber wrote:
Then, I'm observing that the result for
date_to_iso8601("1984", "%Y")
is: 19831231. Is this a bug? I would have expected 19840101.
Indeed, this looks like a strptime bug. For example:
<hansl>
a = strptime("1984", "%Y")
b = strftime(a, "%Y-%m-%d %H:%M")
print b
</hansl>
gives "1983-12-31 00:00", whereas
<python>
from datetime import datetime;
a = datetime.strptime("1984", "%Y");
b = datetime.strftime(a, "%Y-%m-%d %H:%M");
print(b);
</python>
gives "1984-01-01 00:00".
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------