Tomorrow’s Date using Shell Script Commands
This page answers questions like these:
- How to get tomorrow’s date in a shell script?
- How to get tomorrow’s date using a shell command?
- How do I get tomorrow’s date in a shell script?
- How do I get tomorrow’s date using a shell command?
Related Links:
Yesterday's Date using Shell Script Commands
What Day of the Week Was It?
Is this Year a Leap Year? (using Shell Script Commands)
How to get Tomorrow’s Date using a Shell Script Command?
date -d tomorrow "+%Y-%m-%d"
- Get tomorrow’s date as a string in the format “YYYY-MM-DD”.
- The -d option allows you to pass a string which alters the usual output value. Legal strings include (but are not limited too) “yesterday”, “today”, and “tomorrow”.
- The + option allows you to pass a string which alters the usual output format. Legal strings can be composed of normal text and symbols which are expanded by the command:
- %Y = Year as 4 digits.
- %m = Month as 2 digits (01..12).
- %d = Day as 2 digits (01..31).
- %H = Hour as 2 digits (00..23).
- %M = Minute as 2 digits (00..59).
- %S = Second as 2 digits (00..60. Note that 60 can occur for a leap second).
- Some other useful format strings are:
- %A = The full day of the week, e.g. Sunday.
- %a = The abbreviated day of the week, e.g. Sun.
- %B = The full month name, e.g. January.
- %b = The abbreviated month name, e.g. Jan.
How to get the Time One Hour Ahead using a Shell Script Command?
date -d "+1 hour" "+%H:%M:%S"
- Get the time exactly 1 hour in the future in the format HH:MM:SS where HH is in 24-hour time.
Related Links:
Yesterday's Date using Shell Script Commands
What Day of the Week Was It?
Is this Year a Leap Year? (using Shell Script Commands)
Home > Linux / Unix > Tomorrow’s Date using Shell Script Commands
Tags: tomorrow shell script, date, tomorrow’s date, shell script, shell command, linux, unix, solaris, bsd, aix
Copyright © HelpDoco.com
date-tomorrow.txt
Linux-Unix/tomorrows-date-using-shell-script-commands.htm
2