Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Converting a HEX value to a DateTime

Converting a HEX value to a DateTime

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stanimir_Stoyanov
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • S Stanimir_Stoyanov

      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

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups