1curl_getdate(3)                 libcurl Manual                 curl_getdate(3)
2
3
4

NAME

6       curl_getdate - Convert a date string to number of seconds
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       time_t curl_getdate(char *datestring, time_t *now );
12

DESCRIPTION

14       curl_getdate(3)  returns the number of seconds since the Epoch, January
15       1st 1970 00:00:00 in the UTC time zone, for the date and time that  the
16       datestring  parameter  specifies. The now parameter is not used, pass a
17       NULL there.
18

PARSING DATES AND TIMES

20       A "date" is a string containing several items separated by  whitespace.
21       The  order  of the items is immaterial.  A date string may contain many
22       flavors of items:
23
24       calendar date items
25               Can be specified several ways. Month names can only  be  three-
26               letter  english abbreviations, numbers can be zero-prefixed and
27               the year may use  2  or  4  digits.   Examples:  06  Nov  1994,
28               06-Nov-94 and Nov-94 6.
29
30       time of the day items
31               This string specifies the time on a given day. You must specify
32               it with 6 digits with two colons: HH:MM:SS. To not include  the
33               time  in a date string, will make the function assume 00:00:00.
34               Example: 18:19:21.
35
36       time zone items
37               Specifies international time zone. There  are  a  few  acronyms
38               supported,  but  in general you should instead use the specific
39               relative time  compared  to  UTC.  Supported  formats  include:
40               -1200, MST, +0100.
41
42       day of the week items
43               Specifies  a  day  of the week. Days of the week may be spelled
44               out in full (using english): `Sunday', `Monday',  etc  or  they
45               may  be  abbreviated to their first three letters. This is usu‐
46               ally not info that adds anything.
47
48       pure numbers
49               If a decimal number of the form YYYYMMDD appears, then YYYY  is
50               read  as  the year, MM as the month number and DD as the day of
51               the month, for the specified calendar date.
52

EXAMPLES

54       Sun, 06 Nov 1994 08:49:37 GMT
55       Sunday, 06-Nov-94 08:49:37 GMT
56       Sun Nov  6 08:49:37 1994
57       06 Nov 1994 08:49:37 GMT
58       06-Nov-94 08:49:37 GMT
59       Nov  6 08:49:37 1994
60       06 Nov 1994 08:49:37
61       06-Nov-94 08:49:37
62       1994 Nov 6 08:49:37
63       GMT 08:49:37 06-Nov-94 Sunday
64       94 6 Nov 08:49:37
65       1994 Nov 6
66       06-Nov-94
67       Sun Nov 6 94
68       1994.Nov.6
69       Sun/Nov/6/94/GMT
70       Sun, 06 Nov 1994 08:49:37 CET
71       06 Nov 1994 08:49:37 EST
72       Sun, 12 Sep 2004 15:05:58 -0700
73       Sat, 11 Sep 2004 21:32:11 +0200
74       20040912 15:05:58 -0700
75       20040911 +0200
76

STANDARDS

78       This parser was written to handle date formats  specified  in  RFC  822
79       (including  the  update  in RFC 1123) using time zone name or time zone
80       delta and RFC 850 (obsoleted by RFC 1036) and ANSI C's  asctime()  for‐
81       mat.  These  formats  are the only ones RFC 7231 says HTTP applications
82       may use.
83

RETURN VALUE

85       This function returns -1 when it fails to parse the date string. Other‐
86       wise it returns the number of seconds as described.
87
88       On systems with a signed 32 bit time_t: if the year is larger than 2037
89       or less than 1903, this function will return -1.
90
91       On systems with an unsigned 32 bit time_t: if the year is  larger  than
92       2106 or less than 1970, this function will return -1.
93
94       On  systems  with  64  bit  time_t: if the year is less than 1583, this
95       function will return -1. (The Gregorian calendar was  first  introduced
96       1582  so  no  "real"  dates  in  this way of doing dates existed before
97       then.)
98

SEE ALSO

100       curl_easy_escape(3),  curl_easy_unescape(3),  CURLOPT_TIMECONDITION(3),
101       CURLOPT_TIMEVALUE(3)
102
103
104
105libcurl 7.71.1                 January 18, 2018                curl_getdate(3)
Impressum