tafia / calamine

A pure Rust Excel/OpenDocument SpreadSheets file reader: rust on metal sheets
MIT License
1.61k stars 155 forks source link

timedelta and 1904 datetime system #324

Closed dimastbk closed 1 year ago

dimastbk commented 1 year ago

This PR add support timedelta and 1904 datetime system in excel files (partially closed #318).

For 1904 datetime system I'm using a hack like in #299 and I'm not sure that it's good. Maybe something like?

pub enum DataType {
    /// Date or Time, bool - is_1904
    DateTime(f64, bool),
}
 name        old ns/iter  new ns/iter  diff ns/iter  diff %  speedup 
 bench_ods   74,811       75,899              1,088   1.45%   x 0.99 
 bench_xls   32,367       32,154               -213  -0.66%   x 1.01 
 bench_xlsb  139,909      141,788             1,879   1.34%   x 0.99 
 bench_xlsx  197,789      196,129            -1,660  -0.84%   x 1.01
tafia commented 1 year ago

Thanks a lot one more time!