(1)代码
static string dateStr() {
char buf[64] = {0};
time_t tt = time(NULL);
strftime(buf, sizeof(buf), "%a, %b %d %Y %H:%M:%S GMT", gmtime(&tt));
return buf;
}
(2)输出
Fri, Jul 08 2022 07:52:58 GMT