1 .\" **************************************************************************
3 .\" * Project ___| | | | _ \| |
4 .\" * / __| | | | |_) | |
5 .\" * | (__| |_| | _ <| |___
6 .\" * \___|\___/|_| \_\_____|
8 .\" * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
10 .\" * This software is licensed as described in the file COPYING, which
11 .\" * you should have received as part of this distribution. The terms
12 .\" * are also available at https://curl.haxx.se/docs/copyright.html.
14 .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 .\" * copies of the Software, and permit persons to whom the Software is
16 .\" * furnished to do so, under the terms of the COPYING file.
18 .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 .\" * KIND, either express or implied.
21 .\" **************************************************************************
23 .TH CURLOPT_TIMECONDITION 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options"
25 CURLOPT_TIMECONDITION \- select condition for a time request
27 #include <curl/curl.h>
29 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMECONDITION, long cond);
31 Pass a long as parameter. This defines how the \fICURLOPT_TIMEVALUE(3)\fP time
32 value is treated. You can set this parameter to \fICURL_TIMECOND_IFMODSINCE\fP
33 or \fICURL_TIMECOND_IFUNMODSINCE\fP.
35 The last modification time of a file is not always known and in such instances
36 this feature will have no effect even if the given time condition would not
37 have been met. \fIcurl_easy_getinfo(3)\fP with the
38 \fICURLINFO_CONDITION_UNMET\fP option can be used after a transfer to learn if
39 a zero-byte successful "transfer" was due to this condition not matching.
41 CURL_TIMECOND_NONE (0)
43 HTTP, FTP, RTSP, and FILE
46 CURL *curl = curl_easy_init();
48 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
50 /* January 1, 2020 is 1577833200 */
51 curl_easy_setopt(curl, CURLOPT_TIMEVALUE, 1577833200L);
53 /* If-Modified-Since the above time stamp */
54 curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
56 /* Perform the request */
57 curl_easy_perform(curl);
65 .BR CURLOPT_TIMEVALUE "(3), "