tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mktime(3) return value



On Thu, 6 Jan 2011, Matthias Drochner wrote:


the rather absurd value of tms.tm_year

It is not absurd. It is a -1, counting from 1900, so it
means 1899 -- 71 years before the Unix epoch.
Your program gives -2240614800 for me. Just a check:
$ bc -l
2240614800/60/60/24/365.2425
71.00225649169159302837

So, at least on -current, with 64-bit time_t, it looks OK.
With 32-bit time_t, I'd expect an error.

Ah, OK.

I will make sure to test this on a 32-bit system.


-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index