4
21/10/2024 1:28 μμ
Εκκινητής θέματος
You are given a date in format "{day}-{month}-{year}"
Calculate and print the day of week in English.
Examples:
- Input: 18-04-2016; Output: Monday
- Input: 27-11-1996; Output: Wednesday
1 Απάντηση
2
21/10/2024 1:29 μμ
Here is the solution:
?php $input = readline(); $dayOfWeek = new DateTime($input); echo $dayOfWeek->format("l");
Here are all the parameters of the format method of DateTime Class: https://www.php.net/manual/en/function.date.php