tag 26081 notabug
thanks

On 03/13/2017 12:09 AM, Fevzi Karavelioglu wrote:
> Hello, I started getting an error with the following command:
> 
> $> date --date="02:05 tomorrow" +%s
> *date: invalid date `02:05 tomorrow'*
> 
> It appears any time 2 in the morning causes the error. But everything else
> appears to work fine. This appears to have started after midnight on March
> 12 2017. May be something to do with daylight saving as it starts at 2AM?

Everything to do with daylight savings.  In fact, it's a FAQ:
https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

You're trying to start from a time that doesn't exist in your timezone,
due to it falling within the hour that was skipped.  Which is why we
recommend that date-relative commands be executed relative to noon
rather than midnight, since no (known) timezone makes their daylight
savings adjustments at noon, and even if the relative operations land at
11 am or 1 pm after crossing the boundary, you still end up in the right
relative day.


> *$> date --versiondate (GNU coreutils) 8.13Copyright (C) 2011 Free Software

Newer versions of coreutils come with a 'date --debug' option that give
you even more insight into failures, including your use case of
specifying a time that does not exist in your time zone.

I'm closing this as not a bug, but feel free to add further comments to
the thread.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to