Skip to content

Support additional timezone offset formats in string-to-timestamp cast #3775

@parthchandra

Description

@parthchandra

Comet string to timestamp currently supports only Z and +/-HH:MM offsets. Spark uses Java's implementation which supports additional formats (SparkDateTimeUtils.parseTimestampString).
The Spark test DateTimeUtilsSuite - "string to timestamp" exercises these additional formats -

Format Example
±HHMM (no colon) 2015-03-18T12:03:17+0730
±H:MM or ±H:M (single-digit) 2015-03-18T12:03:17+7:30, -1:0
GMT±HH:MM 2015-03-18T12:03:17GMT+07:30
GMT±HHMM 2015-03-18T12:03:17GMT+0730
GMT±HH:MM (space-prefixed) 2015-03-18T12:03:17.123 GMT-01:00
UTC / UTC 2015-03-18 12:03:17UTC, 12:03:17.456 UTC
UTC±HH:MM T18:12:15.12312 UTC+07:30
UT±HH:MM 2015-03-18T12:03:17.12312 UT+07:30

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