Home All Groups Group Topic Archive Search About

Reading int64 from file & converting to DateTime

Author
8 Dec 2006 1:33 PM
clackmannan
Hi, I have a binary file that I'm trying to process with VB.net 2003
The file includes a timestamp that was written to the file using the
following code:

            With m_Writer
                .Write(DateTime.Now.Ticks)             'Time Stamp
            End With

How I do read that timestamp and get it into a usable form?

I can read it using
  myInt64 = BinaryReader.ReadInt64
but I can't seem to do anything with it once I've read it

TIA,
Paul

Author
8 Dec 2006 3:09 PM
Mudhead
myInt64 = BinaryReader.ReadInt64
Dim d As New Date(myInt64)
Debug.WriteLine(d)


<clackman***@hotmail.com> wrote in message
Show quoteHide quote
news:1165584806.139120.305390@79g2000cws.googlegroups.com...
> Hi, I have a binary file that I'm trying to process with VB.net 2003
> The file includes a timestamp that was written to the file using the
> following code:
>
>            With m_Writer
>                .Write(DateTime.Now.Ticks)             'Time Stamp
>            End With
>
> How I do read that timestamp and get it into a usable form?
>
> I can read it using
>  myInt64 = BinaryReader.ReadInt64
> but I can't seem to do anything with it once I've read it
>
> TIA,
> Paul
>
Author
8 Dec 2006 7:22 PM
clackmannan
Mudhead wrote:
> myInt64 = BinaryReader.ReadInt64
> Dim d As New Date(myInt64)
> Debug.WriteLine(d)
>

When you say it like that it seems so obvious :)
Thanks a lot!