humantime icon indicating copy to clipboard operation
humantime copied to clipboard

Windows seems to lack nano Precision

Open pinkforest opened this issue 2 years ago • 0 comments

This seems like a standard library / windows target feature ?

https://github.com/pinkforest/humantime/actions/runs/5357555855/jobs/9718572323#step:4:96

I had to work/around it in multi-platform CI:

  • https://github.com/cyborg-rs/cyborgtime/pull/4

I sent a PR to add CI which replicates the feature which the above action is from:

  • https://github.com/tailhook/humantime/pull/37

I'll send a PR to gate the test

       // TODO: precision bug / feature in Windows side !?                                                                                                           
       // https://github.com/pinkforest/humantime/actions/runs/5357555855/jobs/9718572323#step:4:96                                                             
        #[cfg(not(target_os = "windows"))]
        assert_eq!(
            format_rfc3339_nanos(UNIX_EPOCH +
                Duration::new(1_518_563_312, 789_456_123)).to_string(),
            "2018-02-13T23:08:32.789456123Z");
        #[cfg(target_os = "windows")]
        assert_eq!(
            format_rfc3339_nanos(UNIX_EPOCH +
                Duration::new(1_518_563_312, 789_456_123)).to_string(),
            "2018-02-13T23:08:32.789456100Z");

pinkforest avatar Jun 23 '23 14:06 pinkforest