]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtc: test: Emit the seconds-since-1970 value instead of days-since-1970
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Mon, 28 Apr 2025 10:06:49 +0000 (12:06 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sun, 1 Jun 2025 22:10:18 +0000 (00:10 +0200)
commit46351921cbe11403a4fcab00e76fa03d99a7aef2
tree0deb75efb08968ae4ba6221a3b1a81728b07b39d
parentfe9f5f96cfe8b82d0f24cbfa93718925560f4f8d
rtc: test: Emit the seconds-since-1970 value instead of days-since-1970

This is easier to handle because you can just consult date(1) to convert
between a seconds-since-1970 value and a date string:

$ date --utc -d @3661
Thu Jan  1 01:01:01 AM UTC 1970

$ date -d "Jan 1 12:00:00 AM UTC 1900" +%s
-2208988800

The intended side effect is that this prepares the test for dates before
1970. The division of a negative value by 86400 doesn't result in the
desired days-since-1970 value as e.g. secs=-82739 should map to days=-1.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20250428-enable-rtc-v4-3-2b2f7e3f9349@baylibre.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/lib_test.c