Re: End of Time, *nix Time
Jeff Lightner via Ale <[email protected]> Sat, 25 Apr 2026 14:38:03 -0400
| Newsgroups | gmane.org.user-groups.ale |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format. --===============8850705118117636382== Content-Type: multipart/alternative; boundary="----=_NextPart_000_0036_01DCD4C1.2017A770" Content-Language: en-us This is a multipart message in MIME format. ------=_NextPart_000_0036_01DCD4C1.2017A770 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This made me think of my annoyance at logs for some apps that did epoch = timestamps. More than once I wrote a script to calculate human readable = time as it displayed lines from such logs. I=E2=80=99m sure there are = some who can eyeball epoch and convert it mentally to star date and = other clock/calendar systems but I wasn=E2=80=99t one of them. =20 Which also made me think of the fact that some logs are in UTC rather = than local time zone time. At least I could do that conversion in my = head. =20 Back when we tested for Y2K bugs many of us who were UNIX admins also = tested for future dates against the 32 bit limit and other factors. I = often thought it odd that most UNIX platforms already did 64 bit whereas = many Linux distros didn=E2=80=99t even if they were on a 64 bit = processor. =20 =20 From: Ale <[email protected]> On Behalf Of Ron via Ale Sent: Saturday, April 25, 2026 1:29 PM To: [email protected] Cc: Ron <[email protected]> Subject: Re: [ale] End of Time, *nix Time =20 Bob Toxen via Ale wrote on 2026-04-24 19:43: # Download this program: wget http://verysecurelinux.com/xtime.c # Compile: make xtime # Run: ./xtime -q I downloaded an compiled this. Lots of warnings when running `make`, but it compiled. What am I to make of the output? I can make no sense of it. =20 $ ./xtime -q Copyright (c) Bob Toxen 2026. All rights reserved. This program will analyze your *nix for the well-known bug if the seconds since 01/01/1970 exceeds a signed 32 bit (4-byte) integer. If it outputs abnormal output for years beyond 2038 then your computer will fail at that time, about 12 years from now. Many *nix systems were fixed decades ago so that this variable became an unsigned 32-bit int, which can keep time until 2106. More recently most systems went to a signed 64-bit int. Note that most Unix and Linux distributions corrected the time problem by approximately 2014 to work until 2106 (using an unsigned 32-bit number) or well beyond if using a 64-bit number but maybe the = code will fail before the largest 64-bit signed (292,271,022,989 years) or unsigned number is exceeded. If it is not fixed in your version, well, good luck. sizeof char=3D1, sizeof short=3D2, sizeof int=3D4, sizeof long=3D8, = sizeof long long=3D8, sizeof time_t=3D8 Current years and seconds since the epoch: 56 1777137911 seconds/year:31536000, seconds/year including leap year:31557600, = delta seconds:21600, delta hours:6 Biggest signed 4-byte long: years inc=3D 0, years in the = future=3D 11, Mon Jan 18 19:14:07 2038 Biggest unsigned 4-byte long: years inc=3D 0, years in the = future=3D 79, Sat Feb 6 22:28:15 2106 Time: years inc=3D 1, years in the future=3D 2147437525, = Wed Jun 12 15:25:11 2147483647 Welcome to the Restaurant at the end of the universe. Hello, your = Majesty. Biggest signed 8-byte long: years inc=3D 0, years in the = future=3D 292271022988, ERROR: Invalid seconds since Epoch in localtime Error code: Value too large for defined data type Biggest unsigned 8-byte long: years inc=3D 0, years in the = future=3D -56, Wed Dec 31 15:59:59 1969 =20 ------=_NextPart_000_0036_01DCD4C1.2017A770 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" = xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta = http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8"><meta = name=3DGenerator content=3D"Microsoft Word 15 (filtered = medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Aptos;} @font-face {font-family:Consolas; panose-1:2 11 6 9 2 2 4 3 2 4;} @font-face {font-family:"Tomson Talks"; panose-1:0 0 0 0 0 0 0 0 0 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; font-size:12.0pt; font-family:"Aptos",sans-serif;} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} pre {mso-style-priority:99; mso-style-link:"HTML Preformatted Char"; margin:0in; font-size:10.0pt; font-family:"Courier New";} span.HTMLPreformattedChar {mso-style-name:"HTML Preformatted Char"; mso-style-priority:99; mso-style-link:"HTML Preformatted"; font-family:Consolas;} span.EmailStyle21 {mso-style-type:personal-reply; font-family:"Aptos",sans-serif; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; font-size:10.0pt; mso-ligatures:none;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue = vlink=3Dpurple style=3D'word-wrap:break-word'><div = class=3DWordSection1><p class=3DMsoNormal><span = style=3D'font-size:11.0pt'>This made me think of my annoyance at logs = for some apps that did epoch timestamps.=C2=A0 More than once I wrote a = script to calculate human readable time as it displayed lines from such = logs.=C2=A0 I=E2=80=99m sure there are some who can eyeball epoch and = convert it mentally to star date and other clock/calendar systems but I = wasn=E2=80=99t one of them.=C2=A0 <br><br>Which also made me think of = the fact that some logs are in UTC rather than local time zone = time.=C2=A0 At least I could do that conversion in my head.=C2=A0 = <br><br>Back when we tested for Y2K bugs many of us who were UNIX admins = also tested for future dates against the 32 bit limit and other = factors.=C2=A0=C2=A0 I often thought it odd that most UNIX platforms = already did 64 bit whereas many Linux distros didn=E2=80=99t even if = they were on a 64 bit processor.=C2=A0=C2=A0 <o:p></o:p></span></p><p = class=3DMsoNormal><span = style=3D'font-size:11.0pt'><o:p> </o:p></span></p><div><div = style=3D'border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in = 0in 0in'><p class=3DMsoNormal><b><span = style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span><= /b><span style=3D'font-size:11.0pt;font-family:"Calibri",sans-serif'> = Ale <[email protected]> <b>On Behalf Of </b>Ron via = Ale<br><b>Sent:</b> Saturday, April 25, 2026 1:29 PM<br><b>To:</b> = [email protected]<br><b>Cc:</b> Ron <[email protected]><br><b>Subject:</b> = Re: [ale] End of Time, *nix Time<o:p></o:p></span></p></div></div><p = class=3DMsoNormal><o:p> </o:p></p><div><p class=3DMsoNormal><span = style=3D'font-family:"Tomson Talks",serif'>Bob Toxen via Ale wrote on = 2026-04-24 19:43:</span><o:p></o:p></p></div><blockquote = style=3D'margin-top:5.0pt;margin-bottom:5.0pt'><pre><span = style=3D'font-family:"Tomson Talks",serif'>=C2=A0 # Download this = program:<o:p></o:p></span></pre><pre><span style=3D'font-family:"Tomson = Talks",serif'>=C2=A0 wget <a = href=3D"http://verysecurelinux.com/xtime.c">http://verysecurelinux.com/xt= ime.c</a><o:p></o:p></span></pre><pre><span style=3D'font-family:"Tomson = Talks",serif'>=C2=A0 # Compile:<o:p></o:p></span></pre><pre><span = style=3D'font-family:"Tomson Talks",serif'>=C2=A0 make = xtime<o:p></o:p></span></pre><pre><span style=3D'font-family:"Tomson = Talks",serif'>=C2=A0 # Run:<o:p></o:p></span></pre><pre><span = style=3D'font-family:"Tomson Talks",serif'>=C2=A0 ./xtime = -q</span><o:p></o:p></pre></blockquote><p><span = style=3D'font-family:"Tomson Talks",serif'>I downloaded an compiled = this.</span><o:p></o:p></p><p><span style=3D'font-family:"Tomson = Talks",serif'>Lots of warnings when running `make`, but it = compiled.</span><o:p></o:p></p><p><span style=3D'font-family:"Tomson = Talks",serif'>What am I to make of the output? I can make no sense of = it.</span><o:p></o:p></p><p><o:p> </o:p></p><p><span = style=3D'font-family:"Courier New"'>$ ./xtime -q<br>Copyright (c) Bob = Toxen 2026. All rights reserved.<br><br>This program will analyze = your *nix for the well-known bug if the<br>seconds since 01/01/1970 = exceeds a signed 32 bit (4-byte) integer.<br>If it outputs abnormal = output for years beyond 2038 then your computer<br>will fail at that = time, about 12 years from now.<br><br>Many *nix systems were fixed = decades ago so that this variable became<br>an unsigned 32-bit int, = which can keep time until 2106.<br>More recently most systems went to a = signed 64-bit int.<br><br>Note that most Unix and Linux distributions = corrected the time<br>problem by approximately 2014 to work until 2106 = (using an unsigned<br>32-bit number) or well beyond if using a 64-bit = number but maybe the code<br>will fail before the largest 64-bit signed = (292,271,022,989 years)<br>or unsigned number is = exceeded.</span><o:p></o:p></p><p><span style=3D'font-family:"Courier = New"'><br>If it is not fixed in your version, well, good = luck.<br><br>sizeof char=3D1, sizeof short=3D2, sizeof int=3D4, sizeof = long=3D8, sizeof long long=3D8, sizeof time_t=3D8<br><br>Current years = and seconds since the epoch: 56 1777137911<br> = seconds/year:31536000, seconds/year including leap year:31557600, delta = seconds:21600, delta hours:6<br><br>Biggest signed 4-byte = long: years inc=3D 0, years in = the future=3D 11, Mon Jan 18 = 19:14:07 2038<br>Biggest unsigned 4-byte long: years inc=3D = 0, years in the future=3D = 79, Sat Feb 6 22:28:15 = 2106<br><br>Time: years inc=3D = 1, years in the future=3D 2147437525, Wed Jun 12 15:25:11 = 2147483647<br><br>Welcome to the Restaurant at the end of the = universe. Hello, your Majesty.<br><br>Biggest signed = 8-byte long: years inc=3D 0, = years in the future=3D 292271022988,<br>ERROR: Invalid seconds since = Epoch in localtime<br>Error code: Value too large for defined data = type<br><br>Biggest unsigned 8-byte long: years inc=3D = 0, years in the future=3D = -56, Wed Dec 31 15:59:59 = 1969</span><o:p></o:p></p><p><o:p> </o:p></p></div></body></html> ------=_NextPart_000_0036_01DCD4C1.2017A770-- --===============8850705118117636382== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Ale mailing list [email protected] https://mail.ale.org/mailman/listinfo/ale See JOBS, ANNOUNCE and SCHOOLS lists at http://mail.ale.org/mailman/listinfo --===============8850705118117636382==--