CURLOPT_TIMEVALUE.3 1.3 KB

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