uwp How to get current DateTime in C++ UWP

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

The documentation for the DateTime::UniversalTime states:

"A 64-bit signed integer that represents a point in time as the number of 100-nanosecond intervals prior to or after midnight on January 1, 1601 (according to the Gregorian Calendar)."

This is the same as the Win32 FILETIMEstruct which you need to convert to a 100-nanosecond long long value and set it in the DateTime::UniversalTime field.



Got any uwp Question?