include <time.h>
include <stdio.h>
int main() {
time_t current_time;
time(¤t_time); // 获取当前时间戳
struct tm *local_time = localtime(¤t_time);
printf("Current date and time: %d-%02d-%02d %02d:%02d:%02d\n",
local_time->tm_year + 1900, local_time->tm_mon + 1, local_time->tm_mday,
local_time->tm_hour, local_time->tm_min, local_time->tm_sec);
return 0;
}
利唐i人事HR社区,发布者:hi_ihr,转转请注明出处:https://www.ihr360.com/hrnews/20241225472.html