Skip to content

jde_utc_days Error  #261

Closed
Closed
@adcl-0

Description

@adcl-0

if I create Epoch for dates of 2023 the represantation of date when printed is okay and the jde_utc is also correct.
but when I do that same for dates of year 1608 the representation of dates is wrong but jde calculation is still correct.
but as soon as i try the same for years 1607 and before both the jde calculation as well as the date representation is wrong.
is it a bug or something I am not able to understand.

I haven't tried the python library I just tried the rust
Thanks
Following is an example code and the result :

use hifitime;

pub fn jde_test() {
    let mut test: hifitime::Epoch;
    println!("Dates and JDE for year 1607");
    for i in 25..=31 {
        test = hifitime::Epoch::from_gregorian_utc(1607, 12, i, 0, 0, 0, 0);
        println!("{} - {}", test, test.to_jde_utc_days());
    }
    println!("Dates and JDE for year 1608");
    for i in 1..=5 {
        test = hifitime::Epoch::from_gregorian_utc(1608, 1, i, 0, 0, 0, 0);
        println!("{} - {}", test, test.to_jde_utc_days());
    }
    println!("Dates and JDE for year 2023");
    for i in 1..=5 {
        test = hifitime::Epoch::from_gregorian_utc(2023, 1, i, 0, 0, 0, 0);
        println!("{} - {}", test, test.to_jde_utc_days());
    }
}
Dates and JDE for year 1607
-3277145-01-01T00:00:00 UTC - -1194435819.5
-3277145-01-01T00:00:00 UTC - -1194435818.5
-3277145-01-01T00:00:00 UTC - -1194435817.5
-3277145-01-01T00:00:00 UTC - -1194435816.5
-3277145-01-01T00:00:00 UTC - -1194435815.5
-3277145-01-01T00:00:00 UTC - -1194435814.5
-3277145-01-01T00:00:00 UTC - -1194435813.5
Dates and JDE for year 1608
1592-01-01T00:00:00 UTC - 2308369.5
1592-01-01T00:00:00 UTC - 2308370.5
1592-01-01T00:00:00 UTC - 2308371.5
1592-01-01T00:00:00 UTC - 2308372.5
1592-01-01T00:00:00 UTC - 2308373.5
Dates and JDE for year 2023
2023-01-01T00:00:00 UTC - 2459945.5
2023-01-02T00:00:00 UTC - 2459946.5
2023-01-03T00:00:00 UTC - 2459947.5
2023-01-04T00:00:00 UTC - 2459948.5
2023-01-05T00:00:00 UTC - 2459949.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions