Results 1 to 2 of 2

Thread: Convert Hex to display time and date

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2013
    Posts
    5

    Convert Hex to display time and date

    hi there i have a hex code

    E1956123823600

    =

    2013 10 02 17 30 00

    how do i convert that so it displays the time and date i put in there

    trying to write a script to convert the hex

    thanks in advance

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Re: Convert Hex to display time and date

    It depends how the data is stored. If the data represents a little-endian 64-bit integer, then you can convert it like this:
    Code:
    public DateTime HexToUTCDate(string hex)
    {
        //Convert Hex To UTCDateTime
        long decValue = long.Parse(hex, System.Globalization.NumberStyles.HexNumber);
        DateTime dt = new DateTime(decValue);
    
        return dt;
    }
    Last edited by Serge; Feb 12th, 2013 at 09:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width