tafia / calamine

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

Xlsx deserialized to DateTime #363

Closed yunfengwangluo closed 9 months ago

yunfengwangluo commented 9 months ago

I opened an xlsx file and used a structure to receive it. When deserializing a column of data in the xlsx file in time format "2023/10/7" to "DateTime", there is always a prompt of failure, and there is no problem with the code check. The specific output during cargo run is as follows!

Directly output the content data of each row

[String("序号"), String("产品名称"), String("产品款式"), String("数量"), String("成本"), String("售价"), String("下单日期"), String("交付日期"), String("客户名称"), String("联系方式"), String("送货地址")] [Float(1.0), String("我"), Float(3.0), Float(4.0), Float(5.0), Float(6.0), Float(7.0), DateTime(45206.0), Float(9.0), Float(10.0), Float(11.0)] [Float(2.0), String("w"), Float(4.0), Float(5.0), Float(6.0), Float(7.0), Float(8.0), DateTime(45206.0), Float(10.0), Float(11.0), Float(12.0)]

Attempt to deserialize I tried using "DateTime" to receive this date data

Err(Custom("input contains invalid characters")) Err(Custom("input contains invalid characters"))

yunfengwangluo commented 9 months ago

I have already solved it myself!

tafia commented 9 months ago

Nice :)