I have a DateTime variable defined as DateTime.Now. I need to “convert” this to FileTimeUtc. I must be completely misunderstanding this because I assumed this would work:
DateTime RunTime;
RunTime = System.DateTime.Now.ToFileTimeUtc();
But I get the error cannot implicitly convert type long to system.datetime.
Any help? Thanks.
DateTime.ToFileTimeUtc returns a long, not a
DateTime. From the documentation:This should be:
If you just want the current Coordinated Universal Time, and not the Windows file time, you can use:
See UtcNow for details.