{"id":176,"date":"2018-03-18T17:34:23","date_gmt":"2018-03-18T16:34:23","guid":{"rendered":"http:\/\/test.ekiwi.de\/?p=176"},"modified":"2018-03-18T17:35:44","modified_gmt":"2018-03-18T16:35:44","slug":"deutsches-datum-ausgeben","status":"publish","type":"post","link":"https:\/\/ekiwi.de\/index.php\/176\/deutsches-datum-ausgeben\/","title":{"rendered":"Deutsches Datum ausgeben"},"content":{"rendered":"<p>Hier ein Beispiel wie man ein Datum im &#8222;deutschen Format&#8220; ausgeben kann.<\/p>\n<p><!--more--><\/p>\n<p>Aufruf der Funktion: <code>echo date_de(time());<\/code><\/p>\n<p><strong>Tipp:<\/strong> Mit time() kann man sich den aktuellen Timestamp zur\u00fcckgeben lassen.<\/p>\n<p>Das Format sieht dann so aus: 28, Dezember 2004 (15:49 Uhr)<\/p>\n<h2>Code<\/h2>\n<pre>\r\n&lt;?php\r\n\/\/Datum in deutsches Format ausgeben.\r\nfunction date_de($timestamp)\r\n  {\r\n   $array = array(&quot;Januar&quot;,&quot;Februar&quot;,&quot;M\u00e4rz&quot;,&quot;April&quot;,&quot;Mai&quot;,&quot;Juni&quot;,&quot;Juli&quot;,\r\n   &quot;August&quot;,&quot;September&quot;,&quot;Oktober&quot;,&quot;November&quot;,&quot;Dezember&quot;);\r\n   $month= date(&quot;n&quot;,$timestamp)-1;    \/\/&gt; Hier wird der Monat ermittelt im Format 1-12.\r\n   $day= date(&quot;d&quot;,$timestamp);       \/\/&gt; Hier wird der Monatstag ausgelesen.\r\n   $year= date(&quot;Y&quot;,$timestamp);      \/\/&gt; Hier wird das Jahr ausgelesen.\r\n   $time= date(&quot;H:i&quot;,$timestamp);       \/\/&gt; Hier wird die Zeit ausgelesen.\r\n   $output = $day.&quot;, &quot;.$array[$month].&quot; &quot;.$year.&quot;  ($time Uhr) &quot;;\r\n\r\n   return $output;\r\n}\r\n?&gt;\r\n<\/pre>","protected":false},"excerpt":{"rendered":"<p>Hier ein Beispiel wie man ein Datum im &#8222;deutschen Format&#8220; ausgeben kann.<\/p>\n","protected":false},"author":1,"featured_media":59,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[14],"tags":[31],"class_list":["post-176","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-php"],"_links":{"self":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/176","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/comments?post=176"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/posts\/176\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media\/59"}],"wp:attachment":[{"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/media?parent=176"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/categories?post=176"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi.de\/index.php\/wp-json\/wp\/v2\/tags?post=176"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}