Hallo Leute!
Zurzeit habe ich folgende Datum und Zeitausgabe:
21.01.2010 11:30:21
Bei Case 4 brauche ich aber jetzt folgendes Format
12. Februar um 12:44
Bitte um Hilfe :S
Zurzeit habe ich folgende Datum und Zeitausgabe:
21.01.2010 11:30:21
PHP-Code:
function timestring2time($t, $format) {
switch($format) {
case 1: {
if(strlen($t) != 8) {
echo "<h1>ERROR in timestring2time. Invalid length of inputstring: timestring2time($t, $format)</h1>";
exit;
}
return $t{6}.$t{7}.".".$t{4}.$t{5}.".".$t{0}.$t{1}.$t{2}.$t{3};
}
case 2: { // 2010082685245
/*
if(strlen($t) != 14) {
echo "<h1>ERROR in timestring2time. Invalid length of inputstring: timestring2time($t, $format)</h1>";
exit;
}
*/
return $t{6}.$t{7}.".".$t{4}.$t{5}.".".$t{0}.$t{1}.$t{2}.$t{3}." ".$t{8}.$t{9}.":".$t{10}.$t{11}.":".$t{12}.$t{13};
}
case 3: {
return $t{6}.$t{7}.".".
$t{4}.$t{5}.".".
$t{0}.$t{1}.$t{2}.$t{3}. " ".
$t{8}.$t{9}.":".
$t{10}.$t{11};
}
case 4: {
// to be developed
return $t{6}.$t{7}.".".
$t{4}.$t{5}.".".
$t{0}.$t{1}.$t{2}.$t{3}. " ".
$t{8}.$t{9}.":".
$t{10}.$t{11};
}
default: {
echo "<h1>ERROR in timestring2time. Invalid format: timestring2time($t, $format)</h1>";
exit;
}
}
}
12. Februar um 12:44
Bitte um Hilfe :S
Kommentar