TIP: Click on subject to list as thread! ANSI
echo: public_domain
to: All
from: Paul Edwards
date: 1996-03-20 23:09:40
subject: cvs

I have modified CVSPE to use the getdate.y from CVS 1.5 which
supports the ISO format plus the american and others.  I thought
this was a better idea.  So the following code has been retired.
BFN.  Paul.

#include 
#include 

time_t
get_date(p, now)
    char		*p;
    struct timeb	*now;
{
    int ret;
    struct tm tms;
    time_t tt;
    
    time(&tt);
    tms = *localtime(&tt);
    ret = sscanf(p, "%d-%d-%d", &tms.tm_year,
&tms.tm_mon, &tms.tm_mday);
    if (ret == 3)
    {
        if (tms.tm_year < 100)
        {
            if (tms.tm_year < 50)
            {
                tms.tm_year += 2000;
            }
            else
            {
                tms.tm_year += 1900;
            }
        }
        tms.tm_year -= 1900;
        tms.tm_mon--;
        tms.tm_sec = 0;
        tms.tm_min = 0;
        tms.tm_hour = 0;
        tt = mktime(&tms);
        return (tt);
    }
    return ((time_t)-1);    
}
@EOT:

---
* Origin: X (3:711/934.9)

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