til að fá 1.janúar 2001
$dags = mysql_result($dateresult,$i,“date”);
$dagur = substr($dags,8,2).“.”;
$man = substr($dags,5,2);
$ar = substr($dags,0,4).“ @ ”;
$klukkust = substr($dags,11,2).“:”;
$min = substr($dags,14,2).“:”;
$sek = substr($dags,17,2);
switch ($man) {
case 00:
$month = “”;
break;
case 01:
$month = “janúar”;
break;
case 02:
$month = “febrúar”;
break;
case 03:
$month = “mars”;
break;
case 04:
$month = “apríl”;
break;
case 05:
$month = “maí”;
break;
case 06:
$month = “júní”;
break;
case 07:
$month = “júlí”;
break;
case 08:
$month = “ágúst”;
break;
case 09:
$month = “september”;
break;
case 10:
$month = “október”;
break;
case 11:
$month = “nóvember”;
break;
case 12:
$month = “desember”;
break;
}
$manudir = array(“”,“janúar”,“febrúar”,“mars”,“apríl”,“maí”,“júní”,“júlí”,“ágúst”,“september”,“október”,“nóvember”,“desember”);
$date = “$dagur $month $ar $klukkust$min$sek”;