336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
개념 :
1. 원형 : void _ftime(struct _timeb *timeptr);
2. 구조체 :
struct _timeb
{
time_t time; //time_t
unsigned short; millitm // 1/1000초
short timezone; //세계 표준시와 현지와의 분수의 차이
short dstflag; //써머타임 적용 시 0이 아닌 값, 그밖에는 0
};
소스코드 : main.c
#include <stdio.h>
#include <time.h>
#include <sys/timeb.h>
#include <memory.h>
int main(int argc, const char * argv[])
{
struct timeb tb; // _timeb use windows
struct tm t;
ftime(&tb); // _ftime use windows
t= *localtime(&tb.time);
printf("현재 날짜 및 시간 : %4d. %d. %d. %d. %d. %d. %d \n",t.tm_year+1900, t.tm_mon+1, t.tm_mday, t.tm_hour, t.tm_min, t. tm_sec, tb.millitm);
return 0;
}
결과:
'Programing - C > C Basic grammar ' 카테고리의 다른 글
129 날짜 및 시간을 더하거나 빼기( mktime ) (0) | 2018.05.13 |
---|---|
128 날짜 및 시간을 문자열로 변환(ctime) (0) | 2018.02.18 |
126 날짜및 시간 구하기(localtime) (0) | 2018.01.09 |
visual studio 에서 C4996 error 해결하기 (0) | 2018.01.09 |
125 시간 구하기 ( time ) (0) | 2018.01.05 |