[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to calculate date relative to another date?
From: |
Sami Kerola |
Subject: |
Re: How to calculate date relative to another date? |
Date: |
Tue, 21 May 2019 20:46:26 +0100 |
On Tue, 21 May 2019 at 19:00, Peng Yu <address@hidden> wrote:
> For example, I want to calculate 5 years less a month from May 2018,
> i.e., "2018/05", the result should be "2013/06".
>
> https://www.gnu.org/software/coreutils/manual/html_node/Examples-of-date.html
>
> I don't think the direct calculation of this kind of relative date is
> possible with coreutiles' date command. Some kind of external
> arithmetic calculation must be used. Is it so?
Seems to work fine when date specification is not quite as ambiguous
as "2018/05".
$ date --iso --date='2018-05-01 5 years ago'
2013-05-01
--
Sami Kerola
http://www.iki.fi/kerolasa/
- How to calculate date relative to another date?, Peng Yu, 2019/05/21
- Re: How to calculate date relative to another date?,
Sami Kerola <=
- Re: How to calculate date relative to another date?, Peng Yu, 2019/05/21
- Re: How to calculate date relative to another date?, Leslie S Satenstein, 2019/05/21
- Re: How to calculate date relative to another date?, Steeve McCauley, 2019/05/22
- Re: How to calculate date relative to another date?, Michael Stone, 2019/05/22
- Re: How to calculate date relative to another date?, Bernhard Voelker, 2019/05/23
- Re: How to calculate date relative to another date?, Egmont Koblinger, 2019/05/23
Re: How to calculate date relative to another date?, Egmont Koblinger, 2019/05/23