1
0
Fork 0
yc.hackclub.app/cgi/time.c
yc 159ffc2e95
Add UNIX timestamp CGI script.
Signed-off-by: yc <yc@hackclub.app>
2024-04-24 08:22:20 +00:00

13 lines
317 B
C

#include <stdio.h>
#include <time.h>
int main() {
time_t current_time;
current_time = time(NULL);
printf("Content-type:text/plain\n\n");
if (current_time == ((time_t)-1)) {
printf("Unable to get current time.\n");
return 1;
}
printf("%ld", (long)current_time);
return 0;
}