- var_dump: documentation ( source)
- date_create_from_format: documentation ( source)
- date_format: documentation ( source)
- date_default_timezone_get: documentation ( source)
<?php
function converteData($format, $to_format, $time, $timezone = null)
{
if (!$timezone) {
$timezone = new DateTimeZone(date_default_timezone_get());
}
$d = date_create_from_format($format, $date, $timezone);
return date_format($d, $to_format);
}
var_dump(converteData('d/m/Y', 'd/m/Y', '06/11/1992'));