Skip to content

[Feature]Support timezone-aware datetime assertions #776

@authorjapps

Description

@authorjapps

Linked Issue: #268

Summary

Enable Zerocode datetime assertions to correctly compare datetimes with different timezone offsets and HTTP date formats.

Problem

The $LOCAL.DATETIME.AFTER and $LOCAL.DATETIME.BEFORE assertions were parsing datetimes without considering timezone offsets (e.g., Z, +02:00). This meant wall-clock values were compared instead of actual instants, causing incorrect assertion results for timezone-aware dates.

Acceptance Criteria

  • Datetime assertions parse ISO dates with timezone offsets (e.g., 2019-06-15T11:30:00+02:00)
  • Datetime assertions parse ISO UTC dates (e.g., 2019-06-15T10:00:00.000Z)
  • Datetime assertions parse RFC-1123 HTTP dates (e.g., Sat, 06 Jul 2019 17:07:15 GMT)
  • Comparisons correctly handle equivalent instants across different timezone offsets
  • Plain ISO local datetime format (without timezone) remains supported for backward compatibility
  • New unit tests validate all datetime formats and timezone scenarios

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions