Simon Mourier's Avatar
Simon Mourier's blog (1346 answers on StackOverflow) about Microsoft technologies C#, C/C++, .NET, WinRT, WinUI, COM, Interop, DirectX, Direct2D, Windows, ...
  • 🔎︎ Search
  • Categories
  • Archives
  • About Me
  • c/c++
  • com
  • visual-studio

convert date to string in COM c++

May 2, 2013 See the question and my original answer on StackOverflow

DATE is the COM Automation type. You can use VariantTimeToSystemTime or VariantTimeToDosDateTime :

DATE JobStartTime;
CurrentJob->get_StartTime(&JobStartTime);
SYSTEMTIME st;
VariantTimeToSystemTime(JobStartTime, &st);

You can then also turn it into a FILETIME using SystemTimeToFileTime:

FILETIME ft;
SystemTimeToFileTime(st, &ft);
  • SmoBlog © 2010-2025 Simon Mourier. All rights reserved.
  • Privacy & Terms