DateTimeAspect

class \TYPO3\CMS\Core\Context\DateTimeAspect

Implements
AspectInterface

The Aspect is usually available as "date.*" properties in the Context.

Contains the current time + date + timezone, and needs a DateTimeImmutable object

Allowed properties:

  • timestamp - unix timestamp number
  • timezone - America/Los_Angeles
  • iso - datetime as string in ISO 8601 format, e.g. 2004-02-12T15:19:21+00:00
  • full - the DateTimeImmutable object

Table of Contents

Interfaces

AspectInterface
Interface AspectInterface Think of an aspect like a property bag

Properties

$dateTimeObject  : DateTimeImmutable

Methods

__construct()  : mixed
get()  : DateTimeImmutable|string|int
Fetch a property of the date time object or the object itself ("full").
getDateTime()  : DateTimeImmutable
Return the full date time object

Properties

$dateTimeObject

protected DateTimeImmutable $dateTimeObject

Methods

__construct()

public __construct(DateTimeImmutable $dateTimeImmutable) : mixed

Parameters

$dateTimeImmutable : DateTimeImmutable

get()

Fetch a property of the date time object or the object itself ("full").

public get(string $name) : DateTimeImmutable|string|int

Parameters

$name : string

Tags

throws
AspectPropertyNotFoundException

Return values

DateTimeImmutable|string|int

getDateTime()

Return the full date time object

public getDateTime() : DateTimeImmutable

Return values

DateTimeImmutable
On this page