Skip to content

Format datetime fields in the response model #14296

Closed

Description

@ChiragAgg5k

Tracks PR #14295.

Plan

Goal: Make every response datetime come out as the documented ISO 8601 format with timezone, including values built in memory such as a synchronous function execution, so API responses, webhooks, realtime and function events all match.

What changes (PR #14295):

  • src/Appwrite/Utopia/Response.php: output() normalises every Model::TYPE_DATETIME rule (including array rules) from the database format to Y-m-d\TH:i:s.vP; already-formatted, empty and non-string values are left alone.
  • Removes now-redundant inline DateTime::formatTz() calls in app/controllers/api/account.php, Account/MFA/Challenges/Create.php, Users/Sessions/Create.php and Users/Tokens/Create.php.
  • Extends existing e2e tests for Account, Users, Functions (testSyncCreateExecution) and ProjectWebhooks.

Remaining steps:

  1. Follow-up noted in the PR, not in scope: the functions worker builds the executions.*.update event payload with Model::filter() instead of Response::output(), so its datetimes are not normalised.
  2. Follow-up noted in the PR, not in scope: Messaging/Messages/Delete.php:77 compares DateTime::now() with a formatTz value.

Done when:

Activity

  1. self-assigned this
    on Oct 9, 2026
  2. added
    api / realtime
    product / databases
    product / functions
    product / locale
    product / sites
    product / storage
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api / realtimeproduct / databasesproduct / functionsproduct / localeproduct / sitesproduct / storage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions