Skip to content

ISCE3 DateTime objects cannot parse strings that specify UTC via "Z" ending #255

@Tyler-g-hudson

Description

@Tyler-g-hudson

Attempting to run a job, I encountered an error when attempting to parse a string:

ValueError: Error in file /src/cxx/isce3/core/DateTime.cpp, line 413, function void isce3::core::DateTime::strptime(std::string): ISO-8601 incompatible or bad value for datetime string!

The offending string was a UTC datetime that was in the following style:
'2026-01-01T00:00:00.000000Z'

Discussing this with @bhawkins, he pointed out that of the following three statements, only the third succeeds:

from isce3.core import DateTime
DateTime('2026-01-01T00:00:00.000000Z')
DateTime('2026-01-01T00:00:00.00Z')
DateTime('2026-01-01T00:00:00.000000')

He also pointed out that isce3 uses sscanf under the hood for parsing strings to DateTime objects.

The evidence points to isce3.core.DateTime objects being unable to parse datetimes that end with "Z", which may be confusing to users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions