Write a function that calculates the day of the week for any particular date in the past or future. A typical application is to calculate the day of the week on which someone was born or some other special event occurred.
Following is a simple C function suggested by Sakamoto, Lachman, Keith and Craver to calculate day. The following function returns 0 for Sunday, 1 for Monday, etc.
Output : 1 (Monday)
See this for explanation of the above function.
This article is compiled by Dheeraj Jain and reviewed by GeeksforGeeks team. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
- Date after adding given number of days to the given date
- Zeller's Congruence | Find the Day for a Date
- PHP | Number of week days between two dates
- Tomohiko Sakamoto's Algorithm- Finding the day of the week
- Print day of week using Gregorian Calendar in java
- Convert String to Date in Java
- Java | Current date and time
- Date class in Java (With Examples)
- PHP | Converting string to Date and DateTime
- Program to check if a date is valid or not
- C++ Program to print current Day, Date and Time
- Java | Date format validation using Regex
- Convert timestamp to readable date/time in PHP
- Time Functions in Python | Set-2 (Date Manipulations)