1<?php 2 3namespace Mpdf\Utils; 4 5class PdfDate 6{ 7 8 /** 9 * PDF documents use the internal date format: (D:YYYYMMDDHHmmSSOHH'mm'). The date format has these parts: 10 * 11 * YYYY The full four-digit year. (For example, 2004) 12 * MM The month from 01 to 12. 13 * DD The day from 01 to 31. 14 * HH The hour from 00 to 23. 15 * mm The minute from 00 to 59. 16 * SS The seconds from 00 to 59. 17 * O The relationship of local time to Universal Time (UT), as denoted by one of the characters +, -, or Z. 18 * HH The absolute value of the offset from UT in hours specified as 00 to 23. 19 * mm The absolute value of the offset from UT in minutes specified as 00 to 59. 20 * 21 * @return string 22 */ 23 public static function format($date) 24 { 25 $z = date('O'); // +0200 26 $offset = substr($z, 0, 3) . "'" . substr($z, 3, 2) . "'"; // +02'00' 27 return date('YmdHis', $date) . $offset; 28 } 29 30} 31