note 49401 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 15 Jan 2006 12:48:20 +0000 |
| Subject: | note 49401 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101847@lists.php.net to get a copy of this message | ||
Note Submitter: Alex [AT] kosi2002 [COM]
----
For lazy germans wanting to have a decent formatted
DateString printed, an example you can copy and paste - here, using the current time.
Prints out somthing like: Montag, den 14. Februar 2005
(My Birthday, hooray ;)
Et Voila:
<?php
//showing Dates in German lanuage:
function formatDateString($stamp) {
//initalise String:
//Gettting the months set up...
$monate = array(1=>"Januar",
2=>"Februar",
3=>"März",
4=>"April",
5=>"Mai",
6=>"Juni",
7=>"Juli",
8=>"August",
9=>"September",
10=>"Oktober",
11=>"November",
12=>"Dezember");
//Getting our Month
$monat = date("n", $stamp);
//Getting the Days set up....
$tage =
array("Sonntag","Montag","Dienstag","Mittwoch",
"Donnerstag","Freitag","Samstag");
//Getting Day....
$tag = date("w", $stamp);
$printme = $tage[$tag].", den ".date("d", $stamp).".
".$monate[$monat]." ".date("Y", $stamp);
return $printme;
}
print formatDateString(date(time()));
?>
Thanx all for listening....