5
5
* | (__| |_| | _ <| |___
6
6
* \___|\___/|_| \_\_____|
8
* Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
8
* Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al.
10
10
* This software is licensed as described in the file COPYING, which
11
11
* you should have received as part of this distribution. The terms
18
18
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
* KIND, either express or implied.
21
* $Id: parsedate.c,v 1.11 2004/11/29 08:10:10 bagder Exp $
21
* $Id: parsedate.c,v 1.16 2005/04/26 13:08:49 bagder Exp $
22
22
***************************************************************************/
24
24
A brief summary of the date string formats this parser groks:
87
87
static time_t Curl_parsedate(const char *date);
89
static const char *wkday[] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
90
static const char *weekday[] = { "Monday", "Tuesday", "Wednesday", "Thursday",
91
"Friday", "Saturday", "Sunday" };
92
static const char *month[]= { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
93
"Aug", "Sep", "Oct", "Nov", "Dec" };
89
const char * const Curl_wkday[] =
90
{"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
91
static const char * const weekday[] =
92
{ "Monday", "Tuesday", "Wednesday", "Thursday",
93
"Friday", "Saturday", "Sunday" };
94
const char * const Curl_month[]=
95
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
96
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
372
/* mktime() returns a time_t. time_t is often 32 bits, even on many
373
architectures that feature 64 bit 'long'.
375
Some systems have 64 bit time_t and deal with years beyond 2038. However,
376
even some of the systems with 64 bit time_t returns -1 for dates beyond
377
03:14:07 UTC, January 19, 2038. (Such as AIX 5100-06)
371
381
/* time zone adjust */
389
399
/* Add the time zone diff (between the given timezone and GMT) and the
390
400
diff between the local time zone and GMT. */
391
delta = (tzoff!=-1?tzoff:0) + (t - t2);
401
delta = (long)((tzoff!=-1?tzoff:0) + (t - t2));
393
403
if((delta>0) && (t + delta < t))
394
404
return -1; /* time_t overflow */