Ads 468x60px

##EasyReadMore##

04 7月, 2016

[C] 取得今天是星期幾



1
2
3
4
5
6
7
8
9
10
#include <time.h>

int main(int argc,char **argv)
{
    time_t t = time(NULL);
    struct tm *now = localtime(&t);
    printf("week = %d\n", now->tm_wday);

    return 0;
}

How to get weekday? - http://goo.gl/pqL3Gb

0 意見:

張貼留言

 
Blogger Templates