일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- pycharm
- synology
- GT-S80
- mean
- DFS
- index
- RNN
- pandas
- 삼성소프트웨어멤버십
- 알고리즘
- Lotto
- SPL
- CNN
- imread
- Splunk
- dataframe
- LSTM
- Series
- install
- E-P1
- GitHub
- ipad
- mariadb
- Button
- pip
- javascript
- keras
- Python
- Numpy
- SciPy
- Today
- Total
잠토의 잠망경
본문
[시간을 표현하는 함수]
UTC는 세계 표준 시간으로 지역시간과는 차이가 보인다.
하여 지역시간으로 동기화를 위해서는 Convert할 수 있는 함수가 필요한데 이는
SystemTimeToTzSpecificLocalTime 함수이다.
void C시간SystemTimeToTzSpecificLocalTimeDlg::OnBnClickedButton1() { // TODO: 여기에컨트롤알림처리기코드를추가합니다.
/* The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).
VOID GetSystemTime ( LPSYSTEMTIME lpSystemTime // address of system time structure );
The SystemTimeToTzSpecificLocalTime function converts a Coordinated Universal Time (UTC) to a specified time zone's corresponding local time.
BOOL SystemTimeToTzSpecificLocalTime (
LPTIME_ZONE_INFORMATION lpTimeZoneInformation, // pointer to time zone of interest LPSYSTEMTIME lpUniversalTime, // pointer to universal time of interest LPSYSTEMTIME lpLocalTime // pointer to structure to receive local time ); */
SYSTEMTIME Global; // UTC 시간이저장됨 GetSystemTime(&Global); // UTC 시간을얻음 // 현지의한국시간이아님
SYSTEMTIME Korea; // 한국시간(LOCAL 시간이저장될변수)
// UTC 시간을한국시간으로변경 BOOL retVal = SystemTimeToTzSpecificLocalTime(NULL, &Global, &Korea);
if(!retVal) { DWORD dWord = GetLastError(); } } |
해당 부분은 해당 함수를 동작 시키고 난 후의 Debug 화면이다.