This post is about how to make date/time conversion between Windows::Foundation::DateTime and SYSTEMTIME structure types. Let's go to see by example: // First we obtain the current DateTime from Calendar class Windows::Globalization:: Calendar ^ cal = ref new Windows::Globalization:: Calendar (); Windows::Foundation:: DateTime date= cal->GetDateTime(); // Here, we are converting DateTime to a 64bit value (UniversalTime format) ULARGE_INTEGER time; time.QuadPart = date.UniversalTime; // Now convert the ULARGE_INTEGER to a FILETIME structure FILETIME fileTime; fileTime.dwHighDateTime = time.HighPart; fileTime.dwLowDateTime = time.LowPart; // And finally we get a SYSTEMTIME value by calling the FileTimeToSystemTime Windows Api. SYSTEMTIME systemTime; FileTimeToSystemTime(&fileTime, &systemTime); With C++ and once again, we are doing many things to something simple but sometimes necessary.
Tecnología, Desarrollo de Software, Seguridad Informática, Impresoras 3D, Maker, IA & Machine Learning, UWP, Ingeniería inversa, Ingeniería Social, Electrónica, Robótica, Diseño Gráfico, La Política como Negocio, Marketing, Ingeniería Mecánica, La Vida, La Muerte como parte de la Vida y un sin fín de cosas más que me pasan por la cabeza.