I have this function that runs on the server and I want a different output based on the day of the week, Saturday and Sunday should give weekend message and different for the weekdays.
$timein = date("Y-m-d h:i:s");
$dw = date("D", $timein);
$tm = date("e", $timein);
echo "Current Date: ".$timein."<br>";
echo "Day of the week: ".$dw."<br>";
echo "Timezone: ".$tm."<br>";
and this is the output:
Current Date: 2015-05-15 06:07:12
Day of the week: Wed
Timezone: America/Denver
We are Friday and I was expecting Fri
, I was using w
instead of D
but I always was getting 3 in the results.