mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 21:17:46 +00:00
workaround the tests/touch/60-seconds test to skip leap second
This commit is contained in:
parent
3b3585bbe5
commit
c009e1bed8
1 changed files with 6 additions and 1 deletions
|
@ -337,7 +337,12 @@ fn parse_timestamp(s: &str) -> UResult<FileTime> {
|
|||
format = YYYYMMDDHHMM_DOT_SS_FORMAT;
|
||||
ts = "20".to_owned() + &ts;
|
||||
}
|
||||
|
||||
if (format == YYYYMMDDHHMM_DOT_SS_FORMAT || format == YYMMDDHHMM_DOT_SS_FORMAT)
|
||||
&& ts.ends_with(".60")
|
||||
{
|
||||
// Work around to disable leap seconds
|
||||
ts = ts.replace(".60", ".59");
|
||||
}
|
||||
let tm = time::PrimitiveDateTime::parse(&ts, &format)
|
||||
.map_err(|_| USimpleError::new(1, format!("invalid date ts format {}", ts.quote())))?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue