mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-03 05:57:46 +00:00
Fix 2 Samples
Custom properties would be better in this context using j (no leading 0) rather than d (leading 0) for day of month. Properties has the same problem, and also needs backslashes before p to make it part of a <sup> tag.
This commit is contained in:
@@ -38,7 +38,7 @@ foreach ($customPropertyList as $customPropertyName) {
|
||||
|
||||
break;
|
||||
case 'd': // date
|
||||
$propertyValue = is_numeric($propertyValue) ? date('l, d<\s\u\p>S</\s\u\p> F Y g:i A', (int) $propertyValue) : '*****INVALID*****';
|
||||
$propertyValue = is_numeric($propertyValue) ? date('l, j<\s\u\p>S</\s\u\p> F Y g:i A', (int) $propertyValue) : '*****INVALID*****';
|
||||
$propertyType = 'date';
|
||||
|
||||
break;
|
||||
|
||||
@@ -19,7 +19,7 @@ $helper->log('<b>Document Creator: </b>' . $creator);
|
||||
|
||||
// Read the Date when the workbook was created (as a PHP timestamp value)
|
||||
$creationDatestamp = $spreadsheet->getProperties()->getCreated();
|
||||
$creationDate = Date::formattedDateTimeFromTimestamp("$creationDatestamp", 'l, d<\s\up>S</\s\up> F Y');
|
||||
$creationDate = Date::formattedDateTimeFromTimestamp("$creationDatestamp", 'l, j<\s\u\p>S</\s\u\p> F Y');
|
||||
$creationTime = Date::formattedDateTimeFromTimestamp("$creationDatestamp", 'g:i A');
|
||||
$helper->log('<b>Created On: </b>' . $creationDate . ' at ' . $creationTime);
|
||||
|
||||
@@ -30,7 +30,7 @@ $helper->log('<b>Last Modified By: </b>' . $modifiedBy);
|
||||
// Read the Date when the workbook was last modified (as a PHP timestamp value)
|
||||
$modifiedDatestamp = $spreadsheet->getProperties()->getModified();
|
||||
// Format the date and time using the standard PHP date() function
|
||||
$modifiedDate = Date::formattedDateTimeFromTimestamp("$modifiedDatestamp", 'l, d<\s\up>S</\s\up> F Y');
|
||||
$modifiedDate = Date::formattedDateTimeFromTimestamp("$modifiedDatestamp", 'l, j<\s\u\p>S</\s\u\p> F Y');
|
||||
$modifiedTime = Date::formattedDateTimeFromTimestamp("$modifiedDatestamp", 'g:i A');
|
||||
$helper->log('<b>Last Modified On: </b>' . $modifiedDate . ' at ' . $modifiedTime);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user