What Day of the Week Was It?
This page answers questions like these:
- How do I find out what day of the week is was on a specific date?
- What day was it on ...?
- What day of the week was it on ...?
- What day of the week is it on ...?
- What day of the week will it be on ...?
- What day will it be on a certain Date?
- What day will it be on a given date?
- What day does Christmas fall on?
Related Links:
Tomorrow's Date using Shell Script Commands
Yesterday's Date using Shell Script Commands
Is this Year a Leap Year? (using Shell Script Commands)
What Day of the Week is Christmas Day this year?
date -d "25 dec" "+%A"
date -d "dec 25" "+%A"
- Get the locale’s full weekday name for the 25th of December in the current year.
- The -d option allows you to pass a string which alters the usual output value. Legal strings include (but are not limited too) "DD MMM" and "MMM DD".
- The + option allows you to pass a string which alters the usual output format. Legal strings can be composed of normal text and symbols below which are expanded by the command:
- %A = Locale’s abbreviated weekday name (e.g. Sun).
- %A = Locale’s full weekday name (e.g. Sunday).
- Pros: Month names are case insensitive. Space between date and month is optional. The date can be written before or after the month.
What Day of the Week was New Year’s Day This Year?
date -d "1 jan" "+%A"
date -d "jan 1" "+%A"
date -d "1/1" "+%A"
- Get the locale’s full weekday name for the 1st of January in the current year.
- Pros: Month names are case insensitive. Space between date and month is optional. The date can be written before or after the month.
What Day of the Week will New Year’s Day be Next Year?
date -d "1 jan next year" "+%A"
date -d "jan 1 next year" "+%A"
date -d "1/1 next year" "+%A"
- Get the locale’s full weekday name for the 1st of January next year.
- Pros: Month names and other words are case insensitive. Space between date and month is optional. The date can be written before or after the month.
What Day of the Week was it or will it be on ... ?
date -d "DD MMM YYYY" "+%A"
date -d "MMM DD YYYY" "+%A"
date -d "YYYY/MM/DD" "+%A"
date -d "YYYY-MM-DD" "+%A"
- Get the locale’s full weekday name for day DD of month MM or MMM in year YYYY.
- MMM is a short month name, e.g. Jan, Feb, Mar, etc.
- MM is a 1- or 2-digit month number, e.g. 1 = Jan, 2 = Feb, 3 = Mar, 12 = Dec, etc.
- The + option allows you to pass a string which alters the usual output format. Legal strings can be composed of normal text and symbols below which are expanded by the command:
- %A = Locale’s abbreviated weekday name (e.g. Sun).
- %A = Locale’s full weekday name (e.g. Sunday).
- If "+%A" is omitted, the full date will be output.
Related Links:
Tomorrow's Date using Shell Script Commands
Yesterday's Date using Shell Script Commands
Is this Year a Leap Year? (using Shell Script Commands)
Home > Linux / Unix > What Day of the Week Was It?
Tags: day of week, day of week shell script, date, shell script, shell command, linux, unix, solaris, bsd, aix
Copyright © HelpDoco.com
date-what-day.txt
Linux-Unix/what-day-of-the-week-was-it-using-shell-script-commands.htm
4