[ create a new paste ] login | about

Link: http://codepad.org/JgoX3y7O    [ raw code | output | fork ]

PHP, pasted on Jan 24:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

$one = new DateTime('2012-01-24 13:00');
$two = new DateTime('2012-01-24 06:00');
$three = new DateTime('2012-01-24 08:42');
$four = new DateTime('2012-01-24 12:00');
$five = new DateTime('2012-01-24 06:33');

$array = array($one, $two, $three, $four, $five);

foreach($array as $a){
   $a->modify("-7 hours");

   echo $a->format('Y-m-d H:i') . "\n";
}


Output:
1
2
3
4
5
2012-01-24 06:00
2012-01-23 23:00
2012-01-24 01:42
2012-01-24 05:00
2012-01-23 23:33


Create a new paste based on this one


Comments: