Results 1 to 2 of 2

Thread: How do I convert milliseconds into a timestamp?

  1. #1

    Default How do I convert milliseconds into a timestamp?

    I took this piece from an unencrypted .DAT file:

    Code:
    00 e1 27 17 6f e6 69 c0
    Which translates to 63,374,851,375,000,000 in decimal. This number is definitely microseconds.

    And this huge number cannot bypass the 1st January 1970 00:00:00 format; such a format that most converters use today.

    So, yes. Is there such a converter that uses the 1st January of the year 1 format? Or how shall I make one?

    And by the way, a timestamp is both date and time.

    EDIT- Sorry, it's microseconds, not milliseconds.

    Thanks in advance!
    Last edited by Serapy; 09-19-2010 at 08:57 PM.

  2. #2

    Default

    finally fixed it...

    Code:
    private void generate(object sender, EventArgs e)
            {
                String dateString = yyyy.Text + dd.Text + MM.Text + hh.Text + Mi.Text + ss.Text;
                DateTime timestamp;
                if (!DateTime.TryParseExact(dateString, "yyyyddMMHHmmss", null,
                                           DateTimeStyles.None, out timestamp ))
                return; 
                long ticks = timestamp.Ticks;
                long microseconds = ticks / 10;
                convertedText.Text = microseconds.ToString("X");
            }

Posting Permissions

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