473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Reading int64 from file & converting to DateTime

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

Dec 8 '06 #1
2 5154
myInt64 = BinaryReader.ReadInt64
Dim d As New Date(myInt64)
Debug.WriteLine(d)
<cl*********@hotmail.comwrote in message
news:11**********************@79g2000cws.googlegro ups.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

Dec 8 '06 #2

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!

Dec 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Massimo Fiorentino | last post by:
Hello there! I am a bit of a newbee into the mySQL world and I have a question regarding switching from one DB to another. I have for a couple of years used a very simple CMS-system created by...
3
by: Nikola | last post by:
Hi all, I have a problem converting datetime to integer (and than back to datetime). Depending whether the time is AM or PM, same date is converted to two different integer representations,...
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
16
by: Christine | last post by:
I was wondering if it is possible to read in a text file as a data type other than string. I would like to read it in as some type that handles numbers, like double, or float.
3
by: Usenet User | last post by:
I am trying to read (and then save) a binary file which has certain data structures in it. (The file is in propritetary format produced by a 3rd party MFC application.) I know that those data...
5
by: harishashim | last post by:
I have gone through necessary step and have been able to use a .Net libraries (created using C#) in VB6. It run good untill I try to use certain function in the library that is using Int64 type as...
4
by: vidishasharma | last post by:
I have a bitarray with values as {true,false,true,true} I want to convert this bitarray to Int64. How can I do the same, when I take byte testbytes = new byte; bit1.CopyTo(testbytes, 0) ...
12
by: Allen | last post by:
My C extension works wrong, and debug it, found that sizeof (INT64) = 4, not 8. I compile on Windows XP platform. Please tell me how to fix it to support INT64? Thanks.
7
by: dm3281 | last post by:
Hello, I have this non-standard XML file that I have to manually sort thru each day and verify whether various jobs finish successfully or not. This file isn't a real XML file, so I cannot appear...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.