Gnu date: Difference between revisions
From wikinotes
(Created page with "date formats the current date, or translates between date formats. <source lang="bash"> date -d 'last monday 2pm' date -d 'next monday 2pm' date -d 'today' # alternatively,...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
date formats the current date, or translates between date formats. | date formats the current date, or translates between date formats.<br> | ||
You may also be interested in [[bsd date]]. | |||
= Install = | |||
<blockquote> | |||
<syntaxhighlight lang="bash"> | |||
pacman -S dateutils | |||
</syntaxhighlight> | |||
</blockquote><!-- Install --> | |||
= Usage = | |||
<blockquote> | |||
<source lang="bash"> | <source lang="bash"> | ||
date -d 'last monday 2pm' | date -d 'last monday 2pm' | ||
Line 9: | Line 19: | ||
date -u +"%Y-%m-%dT%H:%M:%SZ" -d 'next monday 5:30pm' | date -u +"%Y-%m-%dT%H:%M:%SZ" -d 'next monday 5:30pm' | ||
</source> | </source> | ||
</blockquote><!-- Usage --> |
Latest revision as of 21:55, 4 November 2023
date formats the current date, or translates between date formats.
You may also be interested in bsd date.
Install
pacman -S dateutils
Usage
date -d 'last monday 2pm' date -d 'next monday 2pm' date -d 'today' # alternatively, if you need a date in iso-8601 format: date -u +"%Y-%m-%dT%H:%M:%SZ" -d 'next monday 5:30pm'