UTC to local time

master
Marek Isalski 6 years ago
parent ce9b14baa3
commit 694fae6a13

@ -6,16 +6,17 @@
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$failed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['failed'],$timezone=$tz); $failed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['failed'],$timezone=$tz);
if ( $failed ) if ( $failed )
print $failed->format( 'j/M/Y \@ g:ia' ); print format_date( $failed->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
?></div> ?></div>
<?php endif; ?> <?php endif; ?>
<?php if ( $transaction[ 'cancelled' ] ): ?> <?php if ( $transaction[ 'cancelled' ] ): ?>
<div class="alert alert-warning" role="alert">This transaction was <strong>cancelled</strong> on <div class="alert alert-warning" role="alert">This transaction was <strong>cancelled</strong> on
<?php <?php
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$cancelled = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['cancelled'],$timezone=$tz); $cancelled = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['cancelled'],$timezone=$tz);
if ( $cancelled ) if ( $cancelled )
print $cancelled->format( 'j/M/Y \@ g:ia' ); print format_date( $cancelled->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
?>.</div> ?>.</div>
<?php endif; ?> <?php endif; ?>
@ -67,7 +68,7 @@
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$created = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['created'],$timezone=$tz); $created = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['created'],$timezone=$tz);
if ( $created ) if ( $created )
print $created->format( 'j/M/Y \@ g:ia' ); print format_date( $created->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
else else
print '<em>pending</em>'; print '<em>pending</em>';
?></p> ?></p>
@ -75,7 +76,7 @@
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$completed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['completed'],$timezone=$tz); $completed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['completed'],$timezone=$tz);
if ( $completed ) if ( $completed )
print $completed->format( 'j/M/Y \@ g:ia' ); print format_date( $completed->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
else else
print '<em>pending</em>'; print '<em>pending</em>';
?></p> ?></p>
@ -83,7 +84,7 @@
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$sent = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['sent'],$timezone=$tz); $sent = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$transaction['sent'],$timezone=$tz);
if ( $sent ) if ( $sent )
print $sent->format( 'j/M/Y \@ g:ia' ); print format_date( $sent->getTimestamp(), 'custom', 'j/M/Y \@ g:ia' );
else else
print '<em>pending</em>'; print '<em>pending</em>';
?></p> ?></p>

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

@ -3,7 +3,7 @@
$tz = new DateTimeZone('UTC'); $tz = new DateTimeZone('UTC');
$completed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$mailshot['completed'],$timezone=$tz); $completed = DateTime::createFromFormat('Y-m-d\TH:i:s.u\Z',$mailshot['completed'],$timezone=$tz);
if ( $completed ) if ( $completed )
print $completed->format( '\s\e\n\t \o\n j/M/Y \a\t ga' ); print format_date( $completed->getTimestamp(), 'custom', '\s\e\n\t \o\n j/M/Y \@ g:ia' );
?></small> ?></small>
<?php foreach ( $mailshot['_view_urls']['text/html'] as $k => $v ): ?> <?php foreach ( $mailshot['_view_urls']['text/html'] as $k => $v ): ?>
<a href="<?php print check_plain($v); ?>" target="_blank">view</a> <a href="<?php print check_plain($v); ?>" target="_blank">view</a>

Loading…
Cancel
Save