‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Context\DateTimeAspect Class Reference
Inheritance diagram for TYPO3\CMS\Core\Context\DateTimeAspect:
TYPO3\CMS\Core\Context\AspectInterface

Public Member Functions

 __construct (\DateTimeImmutable $dateTimeImmutable)
 
DateTimeImmutable string int get (string $name)
 
 getDateTime ()
 

Protected Attributes

DateTimeImmutable $dateTimeObject
 

Detailed Description

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

Definition at line 34 of file DateTimeAspect.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Context\DateTimeAspect::__construct ( \DateTimeImmutable  $dateTimeImmutable)

Definition at line 40 of file DateTimeAspect.php.

Member Function Documentation

◆ get()

DateTimeImmutable string int TYPO3\CMS\Core\Context\DateTimeAspect::get ( string  $name)

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

Returns
‪\DateTimeImmutable|string|int
Exceptions
AspectPropertyNotFoundException

Implements TYPO3\CMS\Core\Context\AspectInterface.

Definition at line 51 of file DateTimeAspect.php.

References TYPO3\CMS\Core\Context\DateTimeAspect\$dateTimeObject, and $name.

◆ getDateTime()

TYPO3\CMS\Core\Context\DateTimeAspect::getDateTime ( )

Return the full date time object

Definition at line 71 of file DateTimeAspect.php.

References TYPO3\CMS\Core\Context\DateTimeAspect\$dateTimeObject.

Member Data Documentation

◆ $dateTimeObject

DateTimeImmutable TYPO3\CMS\Core\Context\DateTimeAspect::$dateTimeObject
protected