1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_TIMEVALUE_LARGE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_FILETIME (3)
9  - CURLOPT_TIMECONDITION (3)
10  - CURLOPT_TIMEVALUE (3)
11Protocol:
12  - HTTP
13Added-in: 7.59.0
14---
15
16# NAME
17
18CURLOPT_TIMEVALUE_LARGE - time value for conditional
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEVALUE_LARGE,
26                          curl_off_t val);
27~~~
28
29# DESCRIPTION
30
31Pass a curl_off_t *val* as parameter. This should be the time counted as
32seconds since 1 Jan 1970, and the time is used in a condition as specified
33with CURLOPT_TIMECONDITION(3).
34
35The difference between this option and CURLOPT_TIMEVALUE(3) is the type of the
36argument. On systems where 'long' is only 32 bits wide, this option has to be
37used to set dates beyond the year 2038.
38
39# DEFAULT
40
410
42
43# %PROTOCOLS%
44
45# EXAMPLE
46
47~~~c
48int main(void)
49{
50  CURL *curl = curl_easy_init();
51  if(curl) {
52    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
53
54    /* January 1, 2020 is 1577833200 */
55    curl_easy_setopt(curl, CURLOPT_TIMEVALUE_LARGE, (curl_off_t)1577833200);
56
57    /* If-Modified-Since the above time stamp */
58    curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
59
60    /* Perform the request */
61    curl_easy_perform(curl);
62  }
63}
64~~~
65
66# %AVAILABILITY%
67
68# RETURN VALUE
69
70Returns CURLE_OK
71