GNURLOPT_TIMEVALUE_LARGE(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’– GNURLOPT_TIMEVALUE_LARGE(3) πŸ’–

okay bestie, welcome to the GNURLOPT_TIMEVALUE_LARGE(3) glow-up πŸ’… this page lives in the curl_easy_setopt options manual, and it’s all about setting a time value for a conditional. no cap, it’s niche but iconic.


🌸 NAME 🌸

  • CURLOPT_TIMEVALUE_LARGE β€” set time value for conditional

✨ SYNOPSIS ✨

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEVALUE_LARGE,
curl_off_t val);

πŸ’– DESCRIPTION πŸ’–

Pass a curl_off_t val as parameter, bestie. This should be the time counted as seconds since 1 Jan 1970, and the time will be used in a condition as specified with CURLOPT_TIMECONDITION(3).

The difference between this option and CURLOPT_TIMEVALUE(3) is the type of the argument. On systems where long is only 32 bit wide, this option has to be used to set dates beyond the year 2038. yes, that’s the whole reason it exists β€” it’s giving β€œwe prepared for the future” energy πŸ”₯

πŸŽ€ DEFAULT πŸŽ€

The default is 0. simple, clean, zero. periodt.

πŸ¦‹ PROTOCOLS πŸ¦‹

This one is for HTTP, FTP, RTSP, and FILE. all four, exactly like that. 🫢

πŸ“ EXAMPLE πŸ“

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");

  /* January 1, 2020 is 1577833200 */
  curl_easy_setopt(curl, CURLOPT_TIMEVALUE_LARGE, (curl_off_t)1577833200);

  /* If-Modified-Since the above time stamp */
  curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);

  /* Perform the request */
  curl_easy_perform(curl);
}

literally the whole little ritual: init, set URL, set the large time value, set the time condition, perform. slay. ✨

⭐ AVAILABILITY ⭐

Added in 7.59.0. note it, bestie πŸŽ€

πŸ”₯ RETURN VALUE πŸ”₯

Returns CURLE_OK. that’s it, that’s the return value. πŸ’…

πŸ’œ SEE ALSO πŸ’œ

See also: CURLOPT_TIMECONDITION(3), CURLOPT_TIMEVALUE_LARGE(3), β€” yes, comma and all, because we keep the details exact around here 🫢


that’s the whole page, bestie β€” brought to you by libcurl 7.59.0, dated 25 Jan 2018, with the footer name GNURLOPT_TIMEVALUE_LARGE(3). mwah πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from