GNURLOPT_TIMEVALUE(3)
π GNURLOPT_TIMEVALUE(3) π
okay bestie so this is a page from the gnurl corner of the curl_easy_setopt options manual β yes, the whole squad of curl_easy_setopt pages, and this one is about setting a time value for conditional requests β¨
πΈ NAME πΈ
CURLOPT_TIMEVALUE β set the time value for your conditional request, periodt π
β¨ SYNOPSIS β¨
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_TIMEVALUE, long val);
π¦ DESCRIPTION π¦
So you pass a long in as val. That's it, that's the vibe π
That number is the time counted as seconds since 1 Jan 1970 (yes, the epoch, we love a classic), and the time is gonna get used in a condition β the condition being whatever you specified with CURLOPT_TIMECONDITION(3). iykyk π
β οΈ okay real talk: on systems wherelongis 32 bit, this option cannot set dates beyond the year 2038 π not me being dramatic, that's literally the limit. ConsiderCURLOPT_TIMEVALUE_LARGE(3)instead and slay on π«Ά
π DEFAULT π
0
π PROTOCOLS π
HTTP, FTP, RTSP, and FILE β she's versatile, she contains multitudes π
π₯ 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, 1577833200L);
/* If-Modified-Since the above time stamp */
curl_easy_setopt(curl, CURLOPT_TIMECONDITION, CURL_TIMECOND_IFMODSINCE);
/* Perform the request */
curl_easy_perform(curl);
}
like look at her go π the timestamp is doing the absolute most and she knows it π
β AVAILABILITY β
Always. literally always, she's not going anywhere ππ«Ά
π« RETURN VALUE π«
Returns CURLE_OK β the good ending, no cap πΈ
π§ SEE ALSO π§
π and that's the page bestie! brought to you bylibcurl 7.37.0, dated17 Jun 2014, filed underGNURLOPT_TIMEVALUE(3)β iconic behavior from start to finish, mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms