#include <iostream>
#include <ctime>
using namespace std;
int main()
{
//time_t
time_t t = time(nullptr);
cout << t << endl;
// tm 타입
int year = 2020;
int mon = 12;
int day = 13;
int hour = 0;
int min = 0;
int sec = 0;
tm tm1;
tm1.tm_year = year - 1900;
tm1.tm_mon = mon - 1;
tm1.tm_mday = day;
tm1.tm_hour = hour;
tm1.tm_min = min;
tm1.tm_sec = sec;
// 특정 서식으로 문자열 출력
char str[80];
strftime(str, sizeof(str), "%Y-%m-%d", &tm1);
cout << str << endl;
//// time-t -> tm 타입 (로컬 타임)
//tm tm2;
//localtime_s(&tm2, &t);
//// tm 타입을 time_t로 변환
//time_t t3;
//tm tm3;
//t3 = mktime(&tm3);
}