TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: David Nugent
date: 1996-09-14 01:38:56
subject: datediff

FA>> ** The world began in 1900...according to time.h

 DN>> Not quite. The actual epoch date can be anything, according
 DN>> to the fancy of the vendor.
~
 FA> That sounds like the date all your XT user clients would put on their
 FA> cheques.:-)

IBMPC bios dates actually start at 1980.


 FA> Which brings me to ask if it wasn't/isn't just a BIOS limitation ?

Not at all associated with anything to do with the PC. K&R compilers
used 1970 as a start date, and that's where it all began.


 FA> ANSI says the year in the time struct is from 1900. So does turbo C.

Ah, NOW I see where the confusion lies. Ok.

I was referring to the value returned by time(), which is a time_t
(invariably a long, but that can, of course, change too if someone needs to
do that). The "epoch" I referred to above is the date
corresponding to the value (time_t)0, which is the earliest date that the
implementation can represent as a time_t.

But yes, the tm_year value reflects the number of years since 1900. In
fact, the entire life of the time_t is limited when it is a (usually)
32-bit value: from epoch to + 2^31 (or 2^32 if unsigned) seconds later. As
a result, if you want absolute dates, then you do have to move away from
C's date/time system. Of course, exact dates don't really apply the further
away you get (various changes to the calendar make dates prior 1800 or so
very relative to where you are, in fact), but I guess that depends on the
application.

Cheers,
David

--- MaltEd/2 1.0.b6
* Origin: Unique Computing Pty Limited (3:632/348)
SEEN-BY: 50/99 620/243 623/630 632/103 107 348 360 633/371 634/388 396
SEEN-BY: 635/301 502 503 544 639/252 711/401 409 410 413 430 808 809 932 934
SEEN-BY: 712/515 713/888 714/906 800/1
@PATH: 632/348 635/503 50/99 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.