%T#13899 Comment added by Bilgus: Rocklua os.date("*t") return 126 in year field on baremetal

Rockbox via rockbox-sf <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.sourceforge
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#13899 - Rocklua os.date("*t") return 126 in year field on baremetal
User who did this - Willliam W (Bilgus)

----------
see:
https://stackoverflow.com/questions/45355478/why-is-the-tm-year-member-in-struct-tm-relative-to-1900-rather-than-1970-in-c-on


QUOTE:

The tm_year field is relative to 1900 on all POSIX-compliant platforms, 
not just on macOS.

The struct tm is designed for parsing, displaying, and manipulating human-readable
dates. 
When it was created, dates were commonly written and even stored without the “19”
part of the year number and the Y2K problem was around 25 years away. So the
convenience of making tm_year directly printable as two digits, by making it
relative to 1900, apparently seemed reasonable at the time.

Unix timestamps are relative to the “Unix epoch”, which is 1970-01-01 00:00:00 UTC.
For the reasons why, see this Q&A.(https://stackoverflow.com/q/1090869/77567)


----------

More information can be found at the following URL:
https://www.rockbox.org/tracker/task/13899#comment45502

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
-- 
rockbox-sf mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.