user3627048 user3627048 - 2 years ago 84 Question

Reading time from Excel file in VB.NET returns an integer

I was trying to read an Excel file to a VB.NET application. When reading the Excel file, the column time in the file does not return a time format, rather it returns an integer, e.g.:

17:14:04 --> 0.718101852
13:26:12 --> 0.559861111
7:26:29 --> 0.31005787

How can I turn these numbers back to time format?

Please Help me thanks

Answer Source

Try like this:

Dim dt As DateTime = (New DateTime()).AddDays(0.559861111)  

It is working for me. It returns:

13:26:12 from 0.559861111  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download