DateTimeFactory
Read onlyYes
FinalYes
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|nullcreateFromDatabaseValue()
public
static createFromDatabaseValue(int|string|null $value, DateTimeFieldType $fieldInformation) : DateTimeImmutable|null
Parameters
- $value : int|string|null
- $fieldInformation : DateTimeFieldType
Return values
DateTimeImmutable|nullcreateFromTimestamp()
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
DateTimeImmutablegetFormatFromTCAConfig()
public
static getFormatFromTCAConfig(array<string|int, mixed> $fieldConfig) : string
Parameters
- $fieldConfig : array<string|int, mixed>