Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Aug 1999 19:25:46 -0400
From:      "Mark S. Reichman" <reichman@twcny.rr.com>
To:        jim@jaguNET.com
Cc:        Eric Lee Green <elgreen@iname.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: FreeBSD not Y2K compliant?
Message-ID:  <37B89DFA.4176AF81@twcny.rr.com>
References:  <199908162245.SAA21886@devsys.jaguNET.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Yep.. Jim seems to be correct. tm_year is the years since
1900.  /usr/src/include/time.h

struct tm {
        int     tm_sec;         /* seconds after the minute [0-60] */
        int     tm_min;         /* minutes after the hour [0-59] */
        int     tm_hour;        /* hours since midnight [0-23] */
        int     tm_mday;        /* day of the month [1-31] */
        int     tm_mon;         /* months since January [0-11] */
        int     tm_year;        /* years since 1900 */
        int     tm_wday;        /* days since Sunday [0-6] */
        int     tm_yday;        /* days since January 1 [0-365] */
        int     tm_isdst;       /* Daylight Savings Time flag */
        long    tm_gmtoff;      /* offset from CUT in seconds */
        char    *tm_zone;       /* timezone abbreviation */
};             




Jim Jagielski wrote:
> 
>     int tm_year;    /* year - 1900 */
> 
> It's supposed to do that.
> 
> Eric Lee Green wrote:
> >
> > The below prints "99" instead of "1999" :-(. AGH! I thought I left that behind
> > with Xenix!
> >
> > #include <stdio.h>
> > #include <time.h>
> > #include <stdlib.h>
> > int main (int argc,char **argv) {
> >       struct *tm t;
> >       time_t today;
> >       today=time(NULL);
> >       t=localtime(&today);
> >       printf("Year = %s\n",t->tm_year);
> > }
> >
> >
> > --
> > Eric Lee Green    http://members.tripod.com/e_l_green
> >   mail: e_l_green@hotmail.com
> >                     ^^^^^^^    Burdening Microsoft with SPAM!
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-questions" in the body of the message
> >
> 
> --
> ===========================================================================
>    Jim Jagielski   |||   jim@jaguNET.com   |||   http://www.jaguNET.com/
>             "That's no ordinary rabbit... that's the most foul,
>             cruel and bad-tempered rodent you ever laid eyes on"
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?37B89DFA.4176AF81>