Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Orekit
Orekit
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 58
    • Issues 58
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 7
    • Merge Requests 7
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Orekit
  • OrekitOrekit
  • Issues
  • #708

Closed
Open
Opened Jul 31, 2020 by Evan Ward@evanward1Developer

Orekit parses non-existent dates in UTC

The AbsoluteDate(String, TimeScale) constructor is inconsistent in its handling of non-existent dates. If the seconds of minute number is >=61 an exception is thrown, but no exception is thrown if the seconds of minute number is <61. For example, an exception will not be thrown for 2009-12-31T23:59:60.5Z which is an invalid date (no leap second at that time), but an exception will be thrown for 2009-12-31T23:59:61.5Z which is also an invalid date.

At a minimum the behavior should be documented. For the sake of consistency all invalid times should be treated the same way. Either invalid times throw exceptions, or they don't. If they don't document the algorithm for converting invalid times to valid times.

The also affects DateTimeComponents.parseDateTime(String) and TimeComponents.parseTime(String).

Failing test case:

       try {
            // leap when not expected
            new AbsoluteDate("2009-12-31T23:59:60.5Z", utc);
            Assert.fail("Expected Exception");
        } catch (OrekitException e) {
            // expected
        }
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: orekit/orekit#708