by nageswaragunupudi » Tue Jan 16, 2018 2:11 pm
Mr Silvio
You stored the values in Excel in text format. So the same text values are read from the range and you do not see any difference. But storing Dates, DateTime values and Time valeus as Text in Excel is not the best practice because these values cannot be used for computations.
Mr. Maurizio has stored the time values in Time format.
Mr. Maurizio
Excel internally stores Dates, DateTime values and Time values as double precision numbers and displays in the required format after conversion.
So the time "08:50:00" is stored as a fraction of day, i.e., ( 8 * 3600 + 50 * 60 ) / 86400 = 0.3680555...
When our program reads the data from Excel, it reads the value as number. We need to convert it back to time format for storage or display in Harbour.
You can do this by
SECTOTIME( nValue * 24 * 3600 ) where nValue is the value read by our program.
Regards
G. N. Rao.
Hyderabad, India