UTC to local time

This commit is contained in:
2018-05-23 05:29:50 +01:00
parent ce9b14baa3
commit 694fae6a13
3 changed files with 10 additions and 9 deletions

View File

@ -6,7 +6,7 @@
$tz = new DateTimeZone('UTC');
$failed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['failed'],$timezone=$tz);
if ( $failed )
print $failed->format( 'j/M/Y \@ g:ia' );
print format_date( $failed->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
?></div>
<?php endif; ?>
@ -16,7 +16,7 @@
$tz = new DateTimeZone('UTC');
$cancelled = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['cancelled'],$timezone=$tz);
if ( $cancelled )
print $cancelled->format( 'j/M/Y \@ g:ia' );
print format_date( $cancelled->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
?>.</div>
<?php endif; ?>
@ -68,7 +68,7 @@
$tz = new DateTimeZone('UTC');
$created = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['created'],$timezone=$tz);
if ( $created )
print $created->format( 'j/M/Y \@ g:ia' );
print format_date( $created->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
else
print '<em>pending</em>';
?></p>