[ create a new paste ] login | about

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

PHP, pasted on Jul 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$month = '07';
$day = '26';
$year = '2012';

$timezone = new DateTimeZone('America/New_York');
		$date = new DateTime( "{$year}-{$month}-{$day}", $timezone );
		print $date->format('Y-m-d H:i:s');

print "\n\n";

print dateImplodeFunction( $year, $month, $day );

function dateImplodeFunction($year, $month, $day){
  $array = array($year, $month, $day);
  $date = date('Y-m-d', strtotime( implode("-", $array)));
  return $date;
}


Output:
1
2
3
2012-07-26 00:00:00

2012-07-26


Create a new paste based on this one


Comments: