Skip to content

CFTimeZone: name and abbreviate GMT offsets like Apple - #138

Open
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/cftimezone-gmt-abbrev
Open

CFTimeZone: name and abbreviate GMT offsets like Apple#138
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/cftimezone-gmt-abbrev

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CFTimeZoneCreateWithTimeIntervalFromGMT gave every zone the same GMT+HH:MM string as both its name and its abbreviation (GMT+00:00 for a zero offset). Apple treats the two separately:

Name: GMT for a zero offset, otherwise GMT with the signed four-digit offset and no colon (GMT+0500, GMT-0530).

Abbreviation: GMT for a zero offset, GMT with the hour for whole hours (GMT+5, GMT+10), and GMT with hour and minutes for the rest (GMT+5:30, GMT+0:30).

Build the padded name and the compact abbreviation separately. The existing Tests/CFTimeZone/basic.m asserted the old GMT+00:00 name and abbreviation and is updated to GMT.

Tests/CFTimeZone/gmt_name.m covers names and abbreviations across zero, whole-hour, half-hour and negative offsets. Verified against Apple CoreFoundation.

This supersedes #137, which fixed only the name format.

CFTimeZoneCreateWithTimeIntervalFromGMT gave every zone the same GMT+HH:MM
string for both its name and its abbreviation.  Apple names a zero offset
GMT and others GMT with a four-digit offset (GMT+0500), but abbreviates them
compactly (GMT, GMT+5, GMT+5:30).  Build the padded name and the compact
abbreviation separately.  The existing basic test is updated.
@DTW-Thalion
DTW-Thalion force-pushed the fix/cftimezone-gmt-abbrev branch from 2fa9bd4 to 9b3efe6 Compare July 24, 2026 15:45
@DTW-Thalion DTW-Thalion reopened this Jul 24, 2026
@DTW-Thalion DTW-Thalion reopened this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant