rbatis / fastdate

fastdate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to support time before christ?

gy0801151351 opened this issue · comments

The structs FastDateTime and Date use u8, u16 to save time data. But now, I would like to save a time before christ, such as "-0001-01-01". Is there any way to support this?

commented

The structs FastDateTime and Date use u8, u16 to save time data. But now, I would like to save a time before christ, such as "-0001-01-01". Is there any way to support this?

you can use this code

DateTime {
    /// 0...999999999
    nano:0,
    /// 0...59
    sec: 0,
    /// 0...59
    min: 0,
    /// 0...23
    hour: 0,
    /// 1...31
    day: 0
    /// 1...12
    mon: 0,
    /// 0000...9999
    year: 0,
    /// timezone offset seconds
    offset: 0,
}