version 1.10, 2009/01/20 13:49:36 |
version 1.11, 2009/01/20 22:55:46 |
|
|
mdoc_atotime(const char *p) |
mdoc_atotime(const char *p) |
{ |
{ |
struct tm tm; |
struct tm tm; |
|
char *pp; |
|
|
(void)memset(&tm, 0, sizeof(struct tm)); |
(void)memset(&tm, 0, sizeof(struct tm)); |
|
|
if (0 == strptime(p, "%b %d %Y", &tm)) |
if (xstrcmp(p, "$Mdocdate$")) |
|
return(time(NULL)); |
|
if ((pp = strptime(p, "$Mdocdate$", &tm)) && 0 == *pp) |
return(mktime(&tm)); |
return(mktime(&tm)); |
if (0 == strptime(p, "%b %d, %Y", &tm)) |
/* XXX - this matches "June 1999", which is wrong. */ |
|
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |
|
return(mktime(&tm)); |
|
if ((pp = strptime(p, "%b %d, %Y", &tm)) && 0 == *pp) |
return(mktime(&tm)); |
return(mktime(&tm)); |
|
|
return(0); |
return(0); |