File fix2038.patch of Package perl-Time-Moment
https://github.com/chansen/p5-time-moment/pull/48
commit c702dce560ed255e98384861e29297134fb60c65
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date: Wed Aug 31 05:29:27 2022 +0200
Fix year 2038 bug
Calculate seconds with 64-bit integers
Fixes #47
This PR was done while working on reproducible builds for openSUSE.
diff --git a/Moment.xs b/Moment.xs
index f8f5593..5ca561e 100644
--- a/Moment.xs
+++ b/Moment.xs
@@ -356,7 +356,7 @@ THX_moment_now(pTHX_ bool utc) {
if (tm == NULL)
croak("localtime() failed: %s", Strerror(errno));
- sec = ((1461 * (tm->tm_year - 1) >> 2) + tm->tm_yday - 25202) * 86400
+ sec = ((1461 * (tm->tm_year - 1) >> 2) + tm->tm_yday - 25202) * 86400LL
+ tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
off = (sec - tv.tv_sec) / 60;
}