‪TYPO3CMS  10.4
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 get (string $name)
 
DateTimeImmutable 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)
Parameters
\DateTimeImmutable$dateTimeImmutable

Definition at line 43 of file DateTimeAspect.php.

Member Function Documentation

◆ get()

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

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

Parameters
string$name
Returns
‪\DateTimeImmutable|string
Exceptions
AspectPropertyNotFoundException

Implements TYPO3\CMS\Core\Context\AspectInterface.

Definition at line 55 of file DateTimeAspect.php.

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

◆ getDateTime()

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

Return the full date time object

Returns
‪\DateTimeImmutable

Definition at line 77 of file DateTimeAspect.php.

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

Member Data Documentation

◆ $dateTimeObject

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