hallo,
gibt es eine Funktion die mir das date (im format mm-tt-yy) in ein Format tt-mm-yy umwandelt?
Gruß Nixdorf
gibt es eine Funktion die mir das date (im format mm-tt-yy) in ein Format tt-mm-yy umwandelt?
Gruß Nixdorf
<?php
$d1 = "11-07-05";
list($m, $d, $y) = explode("-", $d1);
echo date("d.m.Y", mktime(0,0,0, $m,$d,$y));
?>
<?php
$oldDateFormat = '11-07-05';
$newDateFormat = preg_replace_callback('/(\d{2})-(\d{2})-(\d{2})/', 'callback_monat', $oldDateFormat);
echo $newDateFormat;
function callback_monat($treffer)
{
return $treffer[2].'.'.$treffer[1].'.'.$treffer[3];
}
?>
<?php
$in = '11-08-05';
$out = preg_replace('/(\d{2})-(\d{2})-(\d{2})/', '\\2-\\1-\\3', $in);
echo $out;
?>
Kommentar