1
0
Fork 0

Add UNIX timestamp CGI script.

Signed-off-by: yc <yc@hackclub.app>
This commit is contained in:
YoungChief 2024-04-24 08:22:20 +00:00
parent e8932313cd
commit 159ffc2e95
Signed by: yc
SSH key fingerprint: SHA256:/762XoeFACwVxXLtK+gOlFF0brtEkdOeolz90+jCeRw

13
cgi/time.c Normal file
View file

@ -0,0 +1,13 @@
#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;
}