[Scilab-users] scilab and xlsx - files

P M p.muehlmann at gmail.com
Fri Nov 5 10:42:25 CET 2021


Dear,

thanks to the xls-link toolbox I am able to read data directly from an
xlsx-file.

however, there is a strange data conversion going on:

in the xlsx-file a column contains time data such as:

09:27:38    // this is a GMT value

result after reading the data into Scilab is like this
0,394189814814815

It is possible to get the hh:mm:ss back from this, like:

0.394189814814815 * 24 =  9.4605556 --> 9   = hours value
0.4605556 * 60 = 27.63336                  --> 27 = minutes value
0.63336*60 = 38.0016                         --> 38 = seconds value

or:

seconds = 0.394189814814815 * 24 * 60 * 60 ;
date = getdate( seconds )
- however
  --> the date would be wrong
       --> which is obvious, because the initial value does not indicate a
specific day

  --> the time would have to be corrected for daylight saving time (summer
time) if necessary
       --> result is 10:27:38

My question is:
Why is the extract from the xls file not intially in human readable format?
Is it, because EXCEL internally stores the time value in a decimal
fashioned way and only displays in human readable format?

Thank you,
Philpp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20211105/b14a8d45/attachment.htm>


More information about the users mailing list