WorkOS PHP SDK

DateTimeFormat
in package

FinalYes

Renders date-time values in the one form the API accepts: ISO 8601 in UTC with millisecond precision and a literal `Z` suffix.

\DateTimeInterface::RFC3339_EXTENDED keeps the value's own offset (+00:00), which the API rejects.

Table of Contents

Constants

ISO_8601_UTC  : mixed = 'Y-m-d\TH:i:s.v\Z'

Methods

iso8601()  : string|null
Format `$value` as UTC ISO 8601 with a `Z` suffix, or pass `null` through so an omitted optional value stays omitted.

Constants

Methods

iso8601()

Format `$value` as UTC ISO 8601 with a `Z` suffix, or pass `null` through so an omitted optional value stays omitted.

public static iso8601(DateTimeInterface|null $value) : string|null
Parameters
$value : DateTimeInterface|null
Return values
string|null
On this page

Search results