Files
ladybird/Libraries/LibC
Nico Weber 5f595e7e1b LibC: Make localtime() and gmtime() handle years before 1970
Year computation has to be based on seconds, not days, in case
t is < 0 but t / __seconds_per_day is 0.

Year computation also has to consider negative timestamps.

With this, days is always positive and <= the number of days in the
year, so base the tm_wday computation directly on the timestamp,
and do it first, before t is modified in the year computation.
In C, % can return a negative number if the left operand is negative,
compensate for that.

Tested via test-js. (Except for tm_wday, since we don't implement
Date.prototype.getUTCDate() yet.)
2020-08-23 10:42:37 +02:00
..
2020-04-06 11:09:01 +02:00
2020-02-16 10:47:54 +01:00
2020-02-19 16:08:28 +01:00
2020-04-10 13:09:35 +02:00
2020-05-30 15:01:18 +02:00
2020-01-18 09:45:54 +01:00
2020-06-23 14:12:20 +02:00
2020-07-28 17:07:22 +02:00
2020-02-02 10:58:45 +01:00
2020-08-10 11:51:45 +02:00
2020-08-10 11:51:45 +02:00
2020-07-06 10:01:14 +02:00
2020-08-22 20:55:10 +02:00
2020-07-11 11:33:33 +02:00
2020-07-04 10:49:36 +02:00
2020-08-21 12:11:48 +02:00
2020-05-07 23:32:11 +02:00