TIP: Click on subject to list as thread! ANSI
echo: dos_internet
to: mark lewis
from: Leonard Erickson
date: 2003-05-18 01:17:04
subject: NETMAIL?

-=> Quoting mark lewis to Greg Mayman <=-

 ml> one method is mathematical... ie: 1993 - 1900 = two digit date
 ml> of 93

 ml> oops, forgot to add...

 ml> 2003 - 1900 = bad year number of 103 and many of us have seen that
 ml> one... its one of the date problems in bluewave and many fidonet
 ml> message manipulation software... 
 ml> it should'nt have been a subtract but a MODulus (aka clock
 ml> arithmetic)... 

Except that it's not a programmer written function it's a built-in
function in C. dtime or some such.

Ah. found it. gmtime. It returns the following variables:

tm_sec          second (0-59)
tm_min          minute (0-59)
tm_hour         hour   (0-23)
tm_mday         day of month (1-31)
tm_mon          month (0-11)
tm_year         year-1900
tm_wday         day of week (0-6) (Sunday = 0)
tm_yday         day of year (0-365)
tm_isdt         if non-zero, daylight saving time is in effect

This function is part of *standard* C, found on Unix systems, and in
ANSI C.

It's also the only "standard" function that provides the data in this
manner instead of as a string.

So as I said yesterday, it's not a matter of the programmer doing the
math wrong, it's a matter of not reading the docs. 

Whatever the reason was for writing the function that way back in the
mists of time, it's way too late to change it now. 

Me, I try to make sure I read *all* of the info about a function before
I use it in a program. Saved me from trouble many a time.

The programmers *assumed* that tm_year was year mod 100. 

--- FMailX 1.60
* Origin: Shadowgard (1:105/50)
SEEN-BY: 633/267 270
@PATH: 105/50 360 106/2000 633/267

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™.