Gnu date: Difference between revisions

From wikinotes
No edit summary
No edit summary
 
Line 2: Line 2:
You may also be interested in [[bsd date]].
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 10: 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'