bash date variable format

# Source: https://www.tutorialkart.com/bash-shell-scripting/bash-date-format-options-examples/
date '+<format-option><format-option> <format-option>'
# For example:
echo $(date '+%A')
date=$(date '+%A')

# Formats:
# date +%a	Weekday	Name of weekday in short (like Sun, Mon, Tue, Wed, Thu, Fri, Sat)	Mon
# date +%A	Weekday	Name of weekday in full (like Sunday, Monday, Tuesday)	Monday
# date +%b	Month	Name of Month in short (like Jan, Feb, Mar )	Jan
# date +%B	Month	Month name in full short (like January, February)	January
# date +%d	Day	Day of month (e.g., 01)	04
# date +%D	MM/DD/YY	Current Date; shown in MM/DD/YY	02/18/18
# date +%F	YYYY-MM-DD	Date; shown in YYYY-MM-DD	2018-01-19
# date +%H	Hour	Hour in 24-hour clock format	18
# date +%I	Hour	Hour in 12-hour clock format	10
# date +%j	Day	Day of year (001..366)	152
# date +%m	Month	Number of month (01..12) (01 is January)	05
# date +%M	Minutes	Minutes (00..59)	52
# date +%S	Seconds	Seconds (00..59)	18
# date +%N	Nanoseconds	Nanoseconds (000000000..999999999)	300231695
# date +%T	HH:MM:SS	Time as HH:MM:SS (Hours in 24 Format)	18:55:42
# date +%u	Day of Week	Day of week (1..7); 1 is Monday	7
# date +%U	Week	Displays week number of year, with Sunday as first day of week (00..53)	23
# date +%Y	Year	Displays full year i.e. YYYY	2018
# date +%Z	 Timezone	Time zone abbreviation (Ex: IST, GMT)	IST

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
bash date format % bash date format manual bash date formt bash format date variable bash check string date format bash date command format bash format date output get date bash format bash date time in format bash date in format Variable bash script date bash convert date format date format bash example set date format bash bash current date time format format datetime bash bash store date as a variable bash script date displaying as date variable string date formatting in bash bash format today's date format date bash script date format in bash bash variable date format format date stored in variable bash format date bash linux bash date formats bash format time date bash format bash date format time bash datetime format bash format current date bash date variable date bash format %N date in format bash bash date time format bash date human format date format llinux bash get year month day bash interpret date format date format shell script examples datatime format linus bash get date from string format bash date string format Write a shell script to print current month nd year in mm yy format Which command is used to display only the current date in mm/dd/yy format? bash date full month name linux shell script date '+%Y-%m-%d' shell script get current date date month year linux bash format date date in bash only day year and month unix shell code date in text bash date format yyyy-mm-dd format date output linux inux date formati format date linux termianl linux print specific date date unix format \d +\t bash linux format date date in bash script dates in bash shell date format dd-mm-yyyy format date echo month name in shell shell date date command linux yyyMM linux get date format date in bash scripting bash date formatting data format bash bash dates bash date and time format bash date function shell script date date format bash date on bash Write a shell script to display Date in different format along with Time. date shellscript month text in bash bash date d-m-y linux date yyyy-mm-dd date bash script bash date number format bash script use date bash get date in format date in mmddyy format shell linux shell date format bash date -1d whats the format of date in linux format date command linux date - date bash date in shell script date linux format date formats shell bash date bash script date format create date in bash all date format in linux shell script unix date format linux bash script customize date variable yyyymmdd shell to date bash date - 2hour bash get date format YYYY-MM-DD date linux bash script get date format bash date min date time bash 24 hour format date in bash date bash format date bash bash date format date command bash bash date command bash date variable format
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source