Twitter API v2 created_at Timestamps Without Viewer Time Zone Conversion Parameter
0 reputation · 02 Nov 2026, 04:15 UTC
0 reputation · 02 Nov 2026, 04:15 UTC
Twitter API v2 returns tweet created_at as an ISO 8601 UTC string and does not provide a timezone conversion parameter. The public tweet payload also does not include an authoritative viewer or author time zone; account time-zone settings remain a permission boundary and are not returned by public lookup without authorization.
The goal is to display each tweet timestamp in a consistent regional format. Because the API specifies neither viewer local time nor author local time, the rendering rule is unresolved: use the viewer's system time zone, infer author time zone from optional location, or retain UTC for all clients.
Which display time should a client use for created_at when no API time-zone field is available? Should author local time be inferred from the optional location field, or is that a privacy boundary? Is UTC the only supported display value until X adds a timezone parameter?
37275 reputation · 02 Nov 2026, 16:09 UTC
Render created_at in the viewer's local time zone for on-screen display, but keep the original UTC string as the source of truth for sorting, caching, logs, and cross-client consistency. Do not infer the author's local time from the optional location field. UTC is the only authoritative display value the API provides; localized rendering is a client-side choice.
Twitter API v2 returns created_at as an ISO 8601 instant with a Z suffix. The v2 tweet object does not include a viewer time zone, an author time zone, or a server-side conversion parameter. Public lookup also omits account time-zone settings; those remain behind authorization.
The author's location is optional free text. It is not an IANA time zone, it can be outdated or inaccurate, and the API does not authorize clients to convert timestamps from it. Treating it as a time zone is primarily a data-quality problem, though account time-zone settings are also a permission boundary.
tweet.fields=created_at and confirm the value ends in Z.Intl.DateTimeFormat or the equivalent in your client framework.user.location. Display location text separately if you show it at all.GET /2/tweets/:id?tweet.fields=created_at
Confirm the response contains no time-zone parameter and that created_at ends in Z. Inspect the author object: location should be optional free text, with no time-zone fields present without authorization.
new Date(created_at).toLocaleString(undefined, { timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })
Compare that output against the raw UTC string to verify client-side conversion.
This answer assumes the current X API v2 schema still omits a time-zone conversion parameter. API behavior may change; verify the response schema before relying on the absence of a time-zone field. Viewer system time zones can be wrong or manipulated, so do not use converted local time for security decisions or authoritative ordering.
Missing diagnostic detail: Does your client use only public/lookup access, or does it have user authorization that might expose account settings? This determines whether an author time zone could ever be available from the platform.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.