note 49401 added to function.date
| From: | Alex | Date: | Wed, 26 Jan 2005 20:46:29 +0000 |
| Subject: | note 49401 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84041@lists.php.net to get a copy of this message | ||
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....
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49401
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49401&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49401&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49401&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49401&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49401&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49401&report=yes
Search -- http://master.php.net/manage/user-notes.php