Exploring Date Command with various options

VinayGupta
2 min readSep 25, 2021

This Blog will show you, How to use date command with multiple Options.

Let’s jump directly to the hands-on part!!

This is very simple thing like you just write `date` & see the output. But let me show you various option of date command.

# date +%a
Thu
# date +%A
Thursday
# date +%b
Sep
# date +%B
September
# date +%d
23
# date +%D

This how this various options are available in date, but this is not the end… there are more!

%z   +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
#
# date -u
Thu Sep 23 13:41:44 UTC 2021
# date
Thu Sep 23 19:11:48 IST 2021
#

Likewise, there are lots of options supported in date command. For more(extra) options, man date or date --help will be more helpful for linux users.

Thank you!

--

--

VinayGupta

Hey..! I'm Vinay Gupta, on the way of learning new technologies.