I have a timestamp with the value 634876488000000000
and the date expected is 04th November 2012, 18:00:00
. When I convert it though, the year is 3612
instead of 2012
(the day, month and time are all correct).
Here is an example:
Console.WriteLine(DateTime.FromFileTimeUtc(634876488000000000).ToString());
Console.WriteLine(DateTime.FromFileTime(634876488000000000).ToString());
And the output:
04/11/3612 18:00:00
04/11/3612 18:00:00
Upon further research I discovered that if I use Get-Date 634876488000000000
in Powershell, I get the correct, expected date of 04 November 2012 18:00:00
.
Could anyone explain how to correctly convert the time stamp to a .NET DateTime object using C# please?