Repository navigation
Single-episode air date is UTC, like the episode list (jikan-rest#567) - #664
Merged
Merged
Conversation
The single-episode page prints "Aired: Oct 20, 1999(JST)"; PHP read the marker as UTC+9, so getAnimeEpisode() gave 1999-10-20T00:00:00+09:00 while the episode list and Anime::getAired() give 1999-10-20T00:00:00+00:00. The marker is stripped. ModelInvariants gains a non-utc-date rule so no model date can carry another offset unnoticed; before this fix it flagged this one date and nothing else across every recorded page. EpisodeAiredTest compares the two endpoints. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Cards were converted from midnight in Japan to UTC, so "Oct 2, 2026" read as 2026-10-01T15:00Z and a year-only "2027" as 2026-12-31T15:00Z (the previous year), while Anime::getAired(), the episodes and DateRange are UTC midnight. The hidden start date and the shown text now both give UTC midnight; text with a broadcast time still converts from Japan time (a real instant). Checked on every recorded card page: 2,049 snapshot dates move by exactly +9 hours and nothing else changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Anime-card start dates are UTC midnight of the day shown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes jikan-rest#567:
/anime/{id}/episodesand/anime/{id}/episodes/{n}returned differentairedvalues for the same episode (...T00:00:00+00:00against...T00:00:00+09:00).Cause
The single-episode page prints
Aired: Oct 20, 1999(JST).AnimeEpisodeParser::getAired()passed that text, marker included, toParser::parseDate(), and PHP read "(JST)" as a UTC+9 offset. The episode list prints no marker, andAnime::getAired()and about 25 other date sites give UTC midnight.Change
getAired()is UTC midnight of the printed day, the same as everywhere else. The calendar date is unchanged; the instant is 9 hours later. It's under Changed in the changelog, because anyone comparing timestamps will see the difference.ModelInvariantsgains anon-utc-daterule. Across every recorded page it flags exactly this one date. Without the fix it fails; with the fix nothing needs an allowlist.EpisodeAiredTest: the list and the single page agree for the same episode, and the day printed with or without "(JST)", with a space, or month-only gives UTC midnight. It fails without the fix.it_gets_aired_datetest pinned the JST timestamp; it now states the expected date as text.Not changed: card dates
Anime-card start dates (seasonal, schedule, genre, producer lists) are also converted from JST midnight to UTC, so "Oct 2, 2026" comes out as
2026-10-01T15:00:00+00:00: a day earlier thanAnime::getAired(). This predates #656. It deserves its own decision, so it's not in this PR.🤖 Generated with Claude Code