Awesome! You're diving deeper into the date command, which is great. There are indeed many other useful format specifiers.
Here are a few more to help you customize the output even further:
%a: Abbreviated weekday name (e.g.,Tue)%b: Abbreviated month name (e.g.,Dec)%k: Hour (0-23)%l: Hour (1-12)%p: AM or PM%m: Month as a decimal number (01-12)%y: Year as a two-digit number (e.g.,25)%j: Day of year (001-366)%w: Day of week (0-6, 0=Sunday)
Let's try some examples:
-
Short day and month, full year, and 12-hour time with AM/PM:
date +"%a, %b %d, %Y %I:%M %p"%I: Hour (01-12)%M: Minute (00-59)%p: AM or PM designation
You might see something like:
Tue, Dec 16, 2025 06:30 PM -
Using
dateto report the nth day of the year:date +"Today is the %j'th day of %Y"This would output something like:
Today is the 350'th day of 2025(if it's Dec 16th). -
To get the current week number:
date +"Week number: %V"(
%Vgives the ISO week number, where weeks begin on Monday.)
Quick Activity:
Try making your own custom date string using some of these new format specifiers! What kind of date or time information do you want to see?
Remember, you can always consult man date for a comprehensive list if you need to look up a specific one! Just type man date in your terminal and press q to exit.
Feel free to share what you come up with!