]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/docs/libcurl/curl_getdate.3
Various Mac OS X tweaks to get this to build. Probably breaking things.
[icculus/iodoom3.git] / neo / curl / docs / libcurl / curl_getdate.3
1 .\" You can view this file with:
2 .\" nroff -man [file]
3 .\" $Id: curl_getdate.3,v 1.2 2004/02/27 15:34:06 bagder Exp $
4 .\"
5 .TH curl_getdate 3 "5 March 2001" "libcurl 7.0" "libcurl Manual"
6 .SH NAME
7 curl_getdate - Convert an date in a ASCII string to number of seconds since
8 January 1, 1970
9 .SH SYNOPSIS
10 .B #include <curl/curl.h>
11 .sp
12 .BI "time_t curl_getdate(char *" datestring ", time_t *"now" );
13 .ad
14 .SH DESCRIPTION
15 This function returns the number of seconds since January 1st 1970, for the
16 date and time that the
17 .I datestring
18 parameter specifies. The 
19 .I now
20 parameter is there and should hold the current time to allow the datestring to
21 specify relative dates/times. Read further in the date string parser section
22 below.
23 .SH PARSING DATES AND TIMES
24 A "date" is a string, possibly empty, containing many items separated by
25 whitespace.  The whitespace may be omitted when no ambiguity arises.  The
26 empty string means the beginning of today (i.e., midnight).  Order of the
27 items is immaterial.  A date string may contain many flavors of items:
28 .TP 0.8i
29 .B calendar date items
30 This can be specified in a number of different ways. Including 1970-09-17, 70-9-17, 70-09-17, 9/17/72, 24 September 1972, 24 Sept 72, 24 Sep 72, Sep 24, 1972, 24-sep-72, 24sep72.
31 The year can also be omitted, for example: 9/17 or "sep 17".
32 .TP
33 .B time of the day items
34 This string specifies the time on a given day. Syntax supported includes:
35 18:19:0, 18:19, 6:19pm, 18:19-0500 (for specifying the time zone as well).
36 .TP
37 .B time zone items
38 Specifies international time zone. There are a few acronyms supported, but in
39 general you should instead use the specific realtive time compared to
40 UTC. Supported formats include: -1200, MST, +0100.
41 .TP
42 .B day of the week items
43 Specifies a day of the week. If this is mentioned alone it means that day of
44 the week in the future.
45
46 Days of the week may be spelled out in full: `Sunday', `Monday', etc or they
47 may be abbreviated to their first three letters, optionally followed by a
48 period.  The special abbreviations `Tues' for `Tuesday', `Wednes' for
49 `Wednesday' and `Thur' or `Thurs' for `Thursday' are also allowed.
50
51 A number may precede a day of the week item to move forward supplementary
52 weeks.  It is best used in expression like `third monday'.  In this context,
53 `last DAY' or `next DAY' is also acceptable; they move one week before or
54 after the day that DAY by itself would represent.
55 .TP
56 .B relative items
57 A relative item adjusts a date (or the current date if none) forward or
58 backward. Example syntax includes: "1 year", "1 year ago", "2 days", "4
59 weeks".
60
61 The string `tomorrow' is worth one day in the future (equivalent to `day'),
62 the string `yesterday' is worth one day in the past (equivalent to `day ago').
63 .TP
64 .B pure numbers
65 If the decimal number is of the form YYYYMMDD and no other calendar date item
66 appears before it in the date string, then YYYY is read as the year, MM as the
67 month number and DD as the day of the month, for the specified calendar date.
68 .PP
69 .SH RETURN VALUE
70 This function returns zero when it fails to parse the date string. Otherwise
71 it returns the number of seconds as described.
72 .SH AUTHORS
73 Originally written by Steven M. Bellovin <smb@research.att.com> while at the
74 University of North Carolina at Chapel Hill.  Later tweaked by a couple of
75 people on Usenet.  Completely overhauled by Rich $alz <rsalz@bbn.com> and Jim
76 Berets <jberets@bbn.com> in August, 1990.
77
78 It has been modified extensively since imported to curl.
79 .SH "SEE ALSO"
80 .BR GNU date(1)