note 22117 deleted from function.date by victor
| From: | victor@php.net | Date: | Sat, 24 Aug 2002 15:51:46 +0000 |
| Subject: | note 22117 deleted from function.date by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35525@lists.php.net to get a copy of this message | ||
So, here's a really simple script to print out a user-friendly date and time.
This is written for Norwegian standards, but you can easely edit $now to change the format.
<?
$day = date(j); //one digit
$month = date(m); //two digits
$year = date(Y); //four digits
$clock = (date(H).":".date(i)); //24H
if ($month == 01){
$monthnow = "January";
}
elseif ($month == 02){
$monthnow = "February";
}
elseif ($month == 03){
$monthnow = "March";
}
elseif ($month == 04){
$monthnow = "April";
}
elseif ($month == 05){
$monthnow = "May";
}
elseif ($month == 06){
$monthnow = "June";
}
elseif ($month == 07){
$monthnow = "July";
}
elseif ($month == 08){
$monthnow = "August";
}
elseif ($month == 09){
$monthnow = "September";
}
elseif ($month == 10){
$monthnow = "October";
}
elseif ($month == 11){
$monthnow = "November";
}
elseif ($month == 12){
$monthnow = "December";
}
$now = ("$clock - $day. $monthnow $year");
print $now;
?>