Skip to content

Can't parse date with time zone offset without a colon (e.g. -0400) #695

@martinraie

Description

@martinraie

Some RSS feeds define time zone offset in a format '±hhmm' which doesn't include a colon. For example date 2025-08-04T09:35:33-0400 from https://www.al-monitor.com/rss. By https://en.wikipedia.org/wiki/ISO_8601#Time_offsets_from_UTC it seems to be a valid format and is supported by SimpleDateFormat with mask yyyy-MM-dd'T'HH:mm:ssZ. Actually this mask is already included in ROME by default but DateParser adds a "GMT" prefix which breaks the format. SimpleDateFormat supports "GMT±hh:mm" and "±hhmm" (without GMT).

Currently I can fix it by adding yyyy-MM-dd'T'HH:mm:ssZ as additional mask but I thought that maybe ROME should support RFC compliant date format out of the box?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions