본문 바로가기

Software/C/C++

[C++] 밀리세컨드를 시간으로 변환

int s = (int) m_objMediaPosition.Duration;
int h = s / 3600;
int m = (s  - (h * 3600)) / 60;
s = s - (h * 3600 + m * 60);

statusBarPanel2.Text = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);

s = (int) m_objMediaPosition.CurrentPosition;
h = s / 3600;
m = (s  - (h * 3600)) / 60;
s = s - (h * 3600 + m * 60);

statusBarPanel3.Text = String.Format("{0:D2}:{1:D2}:{2:D2}", h, m, s);