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
protected \setasign\SetaPDF2\Core\Type\AbstractType|\setasign\SetaPDF2\Core\Type\PdfStringInterface Date::$_string
The string object representing the date
Format: (D:YYYYMMDDHHmmSSOHH'mm)
Static Methods
stringToDateTime()
Converts an PDF date time string into a DateTime object.
Parameters
- $string: string
Exceptions
Throws \OutOfRangeException
Methods
__construct()
public Date::__construct (
string|\DateTime|(\setasign\SetaPDF2\Core\Type\AbstractType & \setasign\SetaPDF2\Core\Type\PdfStringInterface) $string = null
)The constructor.
The $string parameter can be of various types:
- If a \setasign\SetaPDF2\Core\Type\PdfString object is passed, it will be used as the date value.
- If a DateTime instance is passed, it will be forwarded to the setByDateTime() method.
- If a simple string is passed, it will be passed to create a new DateTime instance which is forward to the setByDateTime() method then.
Parameters
- $string: string|\DateTime|(\setasign\SetaPDF2\Core\Type\AbstractType & \setasign\SetaPDF2\Core\Type\PdfStringInterface)
Exceptions
Throws \OutOfRangeException|\Exception
getValue()
public Date::getValue (
void
): \setasign\SetaPDF2\Core\Type\AbstractType|\setasign\SetaPDF2\Core\Type\PdfStringInterfaceGet the PDF string object.
