coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to calculate date relative to another date?


From: Leslie S Satenstein
Subject: Re: How to calculate date relative to another date?
Date: Wed, 22 May 2019 03:53:05 +0000 (UTC)

Try repositioning or adding ago as 

date --date='2018-05-01 4 years ago 11 months ago' +%Y%m

Regards 
 Leslie
 Leslie Satenstein
Montréal Québec, Canada

 

    On Tuesday, May 21, 2019, 9:17:27 p.m. GMT-4, Peng Yu <address@hidden> 
wrote:  
 
 > 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

What is special about --iso? If I use the following date string, I get
a future time. Why?

$ date --date='2018-05-01 4 years 11 months ago' +%Y%m
202106

201306


-- 
Regards,
Peng

  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]