Last active
November 30, 2018 13:35
-
-
Save nuriye/bb7d46dea64327b3ab7db9da882c8ae2 to your computer and use it in GitHub Desktop.
Wordpress Date Format inkl Days to German
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$date = date_create_from_format('j-m-d', get_the_date('j-m-d')); | |
$weekday = get_weekday_german($date); | |
function get_weekday_german($date) { | |
$weeksdays = array( | |
'Sunday' => 'Sonntag', | |
'Monday' => 'Montag', | |
'Tuesday' => 'Dienstag', | |
'Wednesday' => 'Mittwoch', | |
'Thursday' => 'Donnerstag', | |
'Friday' => 'Freitag', | |
'Saturday' => 'Samstag', | |
); | |
$day = date_format($date, 'l'); | |
$weekday = $weeksdays[$day]; | |
return $weekday; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment