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
- Python program to find day of the week for a given date
- 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
- Date class in Java (With Examples)
- Program to check if a date is valid or not
- Convert String to Date in Java
- Java | Current date and time
- PHP | Converting string to Date and DateTime
- Time Functions in Python | Set-2 (Date Manipulations)
- Java | Date format validation using Regex
- C++ Program to print current Day, Date and Time