Converting a HEX value to a DateTime
-
Hi. I guess you all know about PE files' timestamps. The are in hex, and for example 41DE6BF7 means 07/01/2005 11:01:11. I tried many ways to 'convert' the timestamp to a DateTime object, but they all failed. (DateTime.FromFileTime(...), FromTicks(...) My question is, how to 'convert' the hex value to a DateTime. Thanks in advance and best regards, Stan
-
Hi. I guess you all know about PE files' timestamps. The are in hex, and for example 41DE6BF7 means 07/01/2005 11:01:11. I tried many ways to 'convert' the timestamp to a DateTime object, but they all failed. (DateTime.FromFileTime(...), FromTicks(...) My question is, how to 'convert' the hex value to a DateTime. Thanks in advance and best regards, Stan
See the SDK documentation for IMAGE_FILE_HEADER. This reveals that the field is a 32-bit integer representing the number of seconds since 1 January 1970 00:00:00. Probably the easiest way to handle it is to construct a DateTime representing that date, then use AddSeconds. Stability. What an interesting concept. -- Chris Maunder