Skip to content

Conversation

@fitzner
Copy link

@fitzner fitzner commented Nov 7, 2025

Bugfix time conversion issue when converting from time.RFC3339 to time.UnixDate as this is problematic because RFC3339 is a standardized, unambiguous format with timezone information (e.g., "2023-01-01T12:00:00Z"), while UnixDate is a human-readable format without explicit timezone indicators (e.g., "Sun Jan 1 12:00:00 GMT 2023"). This conversion can lead to timezone ambiguity and parsing errors in systems expecting RFC3339 format, potentially causing authentication failures.

Convert to UTC to avoid parsing errors when timezone can't be determined.

Bugfix time conversion issue when converting from time.RFC3339 to time.UnixDate as this
is problematic because RFC3339 is a standardized, unambiguous format with timezone
information (e.g., "2023-01-01T12:00:00Z"), while UnixDate is a human-readable
format without explicit timezone indicators (e.g., "Sun Jan 1 12:00:00 GMT 2023").
This conversion can lead to timezone ambiguity and parsing errors in systems
expecting RFC3339 format, potentially causing authentication failures.

Convert to UTC to avoid parsing errors when timezone can't be determined.

fmt.Printf(`{"headers":%s, "token":"%s", "expiry":"%s"}`, jsonHdrs,
"", expiry.Format(time.UnixDate))
"", expiry_utc.Format(time.UnixDate))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just say:

expiry.UTC().Format(...)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fitzner , do yo mind fix this suggested change, and we will merge this CL in. Thank you!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Switch to much simpler construct..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants