Desc :
char *asctime( const struct tm *timeptr );
Source Code :
#include <stdio.h>
#include <time.h>
void main()
{
time_t now;
struct tm t;
now = time(NULL);
t = *localtime(&now);
printf("현재 날짜 및 시간: %s\n", asctime(&t));
}
Result :
'C' 카테고리의 다른 글
[C] 177 삼각함수 sin (1) | 2021.02.03 |
---|---|
[C] 176 날짜 및 시간 형식화 strftime() (1) | 2021.02.03 |
[C] 174 날짜 및 시간의 차이 구하기 difftime() (1) | 2021.02.02 |
[C] 173 날짜 및 시간 더하고빼기 mktime() (1) | 2021.02.02 |
[C] 172 날짜 및 시간을 문자열로 변환 ctime (1) | 2021.02.02 |