setasign\SetaPDF2\Core\DataStructure

Date Data structure class for date objects

File: /SetaPDF v2/Core/DataStructure/Date.php
Old class name (alias): \SetaPDF_Core_DataStructure_Date

Class hierarchy

Implements

Summary

Properties

$_string

The string object representing the date

Format: (D:YYYYMMDDHHmmSSOHH'mm)


Static Methods

stringToDateTime()

public static Date::stringToDateTime (
string $string
): \DateTime

Converts an PDF date time string into a DateTime object.

Parameters
$string : string
 
Exceptions

Throws \OutOfRangeException


Methods

__construct()

public Date::__construct (
string|\DateTime|\SetaPDF_Core_Type_String $string = null
)

The constructor.

The $string parameter can be of various types:

Parameters
$string : string|\DateTime|\SetaPDF_Core_Type_String
 
Exceptions

Throws \OutOfRangeException,\Exception

getAsDateTime()

public Date::getAsDateTime (
void
): \DateTime

Get the PDF date as a DateTime object.

getValue()

Get the PDF string object.

See

setByDateTime()

public Date::setByDateTime (
\DateTimeInterface $dateTime
): void

Set the date by a DateTime object.

Parameters
$dateTime : \DateTimeInterface
 

toPhp()

public Date::toPhp (
void
): mixed

Get the date as a PHP string.

See