date command examples
This pages shows examples of using the date command.
Basic date usage
Just type date in the command line:
Using templates for formatting output
There's a whole list of variable names that allow you to format the date command output to exactly your liking.
Things you can do with this formatting feature:
show only part of the date info - today's day of the week or today's month or year
rearrange the order of date fields reported by the command
rearrange the format of reporting a particular thing - showing two digits for year number instead of four, etc
Here's an example:
See Also
Last updated