Skip to content

Instantly share code, notes, and snippets.

@nuriye
Last active November 30, 2018 13:35
Show Gist options
  • Save nuriye/bb7d46dea64327b3ab7db9da882c8ae2 to your computer and use it in GitHub Desktop.
Save nuriye/bb7d46dea64327b3ab7db9da882c8ae2 to your computer and use it in GitHub Desktop.
Wordpress Date Format inkl Days to German
$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