[Top][All Lists]

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

Re: Date Computations cot executing properly!!

From: urvashi singla
Subject: Re: Date Computations cot executing properly!!
Date: Thu, 31 Oct 2013 00:14:46 +0530

Thank You!! But what if I execute this in a London timezone instead in my timezone? 

On Thu, Oct 31, 2013 at 12:05 AM, Eric Blake <address@hidden> wrote:
On 10/30/2013 12:27 PM, urvashi singla wrote:
> Hi,
> If i execute following computation -
> Next=$(date +%Y%m%d --date="$User 1 day)

> It gives correct result for all except for 20130927. For 20130927 it gives
> 20130927 instead of next date i.e. 20130928 I don't understand why is this
> so? Is this a bug?

No, this is a manifestation of daylight savings.  20130927 happens to
have 25 hours in your timezone, but '1 day' only increments by 24 hours.
 This is a FAQ; to get the behavior you desire, anchor your time to noon
rather than the default of midnight (so that even with the fuzz of
daylight savings causing 23- or 25-hour days, you still land in the
desired destination day).

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

reply via email to

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