Como cambiar el formato de fechas

En el README.txt del módulo Date podemos encontrar la solución

Example, the following will create a date for the local value in one timezone, adjust it to a different timezone, then return the offset in seconds  in the new timezone for the input date; The offset will be adjusted for both the timezone difference and daylight savings time, if necessary:

$date = date_create('2007-03-11 02:00:00', timezone_open('America/Chicago'));
$chicago_time = date_format($date, 'Y-m-d H:i');

print 'At '. $chicago_time .' in Chicago, the timezone offset in seconds  was '. date_offset_get($date);

Etiquetas: