Converting a Double to DateTime

  • Thread starter Thread starter Ollie
  • Start date Start date
Now I feel really silly.

I have taken a closer look at the binary file and noticed I was reading the
wrong section of bytes form the file.

It now works a treat.

Thanks for all the help. Your resonses have given me a better understanding
and I am sure it helped find my error.

Sorry guys.

Ollie said:
Using VB I can open the file for Binary Access
Open [filename] For Binary Access Read Lock Read Write As #1

Populate my variables with contents of the file.
Get #1, , myType

And then covert the double to a DateTime
Format(myType.myDateDouble, "dd-mm-yyyy")

And it works fine. What is interesting is the value of the double in VB is
different to C#

Does this help a all.

Well, I don't know enough about how VB works to say for sure, but it
will probably help someone else to help you.

Could you give an example of the value VB reads (as a floating point
number), the value C# reads, and the data in the file?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top