You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nianli/当前时间的获取.c

14 lines
338 B

6 years ago
#include <stdio.h>
#include <time.h>
int main ()
{
time_t t;
struct tm * lt;
time (&t);
lt = localtime (&t);
printf ( "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD>%d/%d/%d %d:%d:%d\n",lt->tm_year+1900, lt->tm_mon+2, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec);
if(lt->tm_mon+1>0&&lt->tm_mon+1<5)
printf("\nҹ<EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><EFBFBD><EFBFBD>˯<EFBFBD><EFBFBD>");
return 0;
}