In looking at a DateTime struct in the debugger via SOS.dll, I see...
0:096> !DumpVC 000007feed1ddff8 000000028036d890
Name: System.DateTime
MethodTable: 000007feed1ddff8
EEClass: 000007feecbed6b0
Size: 24(0x18) bytes
File: C:\Windows\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib. dll
Fields:
MT Field Offset Type VT Attr Value Name
000007feed1e1158 40000d6 0 System.UInt64 1 instance 5246421159766325152 dateData
How can interpret "5246421159766325152" as a DateTime? Is there a way I can create a DateTime from this value to get the human-readable version?
!Psscor2.PrintDateTime OBJADD
R or !sosex.mdt System.DateTime DATAADDR
.
DateTime.FromBinary(5246421159766325152)
If the Int64 value is in between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks, then you can call the overloaded constructor for a DateTime taking an Int64.
Your particular value falls outside of this range though. As @Boo mentioned, you can use the static DateTime.FromBinary method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With