Re: Observation of hysteresis in a GNU libc time conversion function

2023-01-19 Thread Ihor Radchenko
Max Nikulin writes: >> Also, see >> https://stackoverflow.com/questions/20104531/weird-mktime-logic-with-negative-seconds > > My expectation is that ±1 day (or month) should preserve local time > hours (e.g. 11:00 CET -> 11:00 CEST) if such moment of time exists. ±24 > hours, ±24*60 minutes, ±2

Re: Observation of hysteresis in a GNU libc time conversion function

2023-01-18 Thread Max Nikulin
On 18/01/2023 16:54, Ihor Radchenko wrote: This is problematic. You are putting MINUTES out of normal range. (Isn't it really broken?) https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html It uses the values of the other components to determine the calendar time;

Re: Observation of hysteresis in a GNU libc time conversion function

2023-01-18 Thread Max Nikulin
On 18/01/2023 16:54, Ihor Radchenko wrote: Max Nikulin writes: (dt '(-90 -60 -31 -30 -29 -15 0 15 29 30 31 60 90)) This is problematic. You are putting MINUTES out of normal range. Actually after some experiments and surprising results I figured out what really happens. I modifi

Re: Observation of hysteresis in a GNU libc time conversion function

2023-01-18 Thread Ihor Radchenko
Max Nikulin writes: > (dt '(-90 -60 -31 -30 -29 -15 0 15 29 30 31 60 90)) This is problematic. You are putting MINUTES out of normal range. Looking at https://codecogs.com/library/computing/c/time.h/ctime.php?alias=mktime, out-of-range minutes are not documented. Also, see https://stac

Observation of hysteresis in a GNU libc time conversion function

2023-01-17 Thread Max Nikulin
#+title: Observation of hysteresis in a GNU libc time conversion function #+begin_abstract The ~mktime~ function in GNU libc for specific arguments may possess properties similar to ferromagnetic materials. Dependence of returned value on arguments passed during earler calls gives evidences that