Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to support time before christ? #4

Open
gy0801151351 opened this issue Mar 3, 2023 · 1 comment
Open

How to support time before christ? #4

gy0801151351 opened this issue Mar 3, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@gy0801151351
Copy link

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?

@zhuxiujia
Copy link
Member

zhuxiujia commented Oct 13, 2023

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,
}

@zhuxiujia zhuxiujia added the help wanted Extra attention is needed label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants