20#ifndef PROTOCORE_HTTP_DATE_H
21#define PROTOCORE_HTTP_DATE_H
35#define PC_HTTP_DATE_MAX 30
41inline uint8_t
pc_http_date(time_t epoch,
char *out, uint32_t out_cap)
43 if (!out || out_cap == 0)
52 struct tm broken_down;
58 return (uint8_t)strftime(out, out_cap,
"%a, %d %b %Y %H:%M:%S GMT", &broken_down);
uint8_t pc_http_date(time_t epoch, char *out, uint32_t out_cap)
Write epoch into out as an IMF-fixdate in GMT.
Reentrant UTC broken-down time, portable across the host and target toolchains.
struct tm * pc_gmtime_r(const time_t *epoch, struct tm *out)
Convert epoch to broken-down UTC in caller storage (reentrant).