at the end of my webpage I want to display the date of the used xml-file. I do it with this code:
<?php
$html = "";
$filename = '../XML-Daten/Wein.xml';
$Speicherdatum = date('j. n. Y', filemtime($filename));
setlocale(LC_TIME, "de_DE");
$wochentag = strftime("%A", $Speicherdatum);
$jahr = date('Y');
$html .="<div id='ca'>© Company 1990 - $jahr<br />
Aktualisiert: $wochentag, den $Speicherdatum</div>";
echo $html;
?>
Now I get the right date ($Speicherdatum) but the day is always "thursday". Where is my error??
The second parameter of strftime
expects an integer timestamp and not a formatted date string.
Try this instead:
$wochentag = strftime("%A", filemtime($filename));