initial commit
This commit is contained in:
14
sb-date.c
Normal file
14
sb-date.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
int main() {
|
||||
time_t t = time(NULL);
|
||||
struct tm tm = *localtime(&t);
|
||||
|
||||
const char *months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
|
||||
|
||||
printf("%s %02d %d\n", months[tm.tm_mon], tm.tm_mday, tm.tm_year + 1900);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user