CURLOPT_TIMEVALUE_LARGE.3 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. .\" generated by cd2nroff 0.1 from CURLOPT_TIMEVALUE_LARGE.md
  2. .TH CURLOPT_TIMEVALUE_LARGE 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_TIMEVALUE_LARGE \- time value for conditional
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEVALUE_LARGE,
  9. curl_off_t val);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a curl_off_t \fIval\fP as parameter. This should be the time counted as
  13. seconds since 1 Jan 1970, and the time is used in a condition as specified
  14. with \fICURLOPT_TIMECONDITION(3)\fP.
  15. The difference between this option and \fICURLOPT_TIMEVALUE(3)\fP is the type of the
  16. argument. On systems where \(aqlong\(aq is only 32 bits wide, this option has to be
  17. used to set dates beyond the year 2038.
  18. .SH DEFAULT
  19. 0
  20. .SH PROTOCOLS
  21. This functionality affects http only
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  29. /* January 1, 2020 is 1577833200 */
  30. curl_easy_setopt(curl, CURLOPT_TIMEVALUE_LARGE, (curl_off_t)1577833200);
  31. /* If-Modified-Since the above time stamp */
  32. curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
  33. /* Perform the request */
  34. curl_easy_perform(curl);
  35. }
  36. }
  37. .fi
  38. .SH AVAILABILITY
  39. Added in curl 7.59.0
  40. .SH RETURN VALUE
  41. Returns CURLE_OK
  42. .SH SEE ALSO
  43. .BR CURLINFO_FILETIME (3),
  44. .BR CURLOPT_TIMECONDITION (3),
  45. .BR CURLOPT_TIMEVALUE (3)