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)
|