DateTimeFactory

Read onlyYes
FinalYes
Internal

Table of Contents

Methods

createFomDatabaseValueAndTCAConfig()  : DateTimeImmutable|null
createFromDatabaseValue()  : DateTimeImmutable|null
createFromTimestamp()  : DateTimeImmutable
Create a DateTimeImmutable object from a unix timestamp in server localtime
getFormatFromTCAConfig()  : string

Methods

createFomDatabaseValueAndTCAConfig()

public static createFomDatabaseValueAndTCAConfig(int|string|null $value, array<string|int, mixed> $fieldConfig) : DateTimeImmutable|null
Parameters
$value : int|string|null
$fieldConfig : array<string|int, mixed>
Return values
DateTimeImmutable|null

createFromDatabaseValue()

public static createFromDatabaseValue(int|string|null $value, DateTimeFieldType $fieldInformation) : DateTimeImmutable|null
Parameters
$value : int|string|null
$fieldInformation : DateTimeFieldType
Return values
DateTimeImmutable|null

createFromTimestamp()

Create a DateTimeImmutable object from a unix timestamp in server localtime

public static createFromTimestamp(int $timestamp) : DateTimeImmutable

Alternative to \DateTimeImmutable('@…') which forces UTC timezone

Parameters
$timestamp : int
Return values
DateTimeImmutable

getFormatFromTCAConfig()

public static getFormatFromTCAConfig(array<string|int, mixed> $fieldConfig) : string
Parameters
$fieldConfig : array<string|int, mixed>
Return values
string

        
On this page

Search results