git: date - Upgrade calculations, add some gnu date -d support

Matthew Dillon dillon at
Wed Feb 8 10:19:47 PST 2023

commit 4238ce6f0c6df33ce677ae298b245c62cd60fb43
Author: Matthew Dillon <dillon at>
Date:   Wed Feb 8 10:15:46 2023 -0800

    date - Upgrade calculations, add some gnu date -d support
    * Use long instead of int for numerous calculations, fixing a number of
      date calculation overflow issues.
    * Add -d support (a gnu date option).  Make -d an alias for -v.
      In addition to the formats already supported, we now support
      +/-Ndays seconds, minutes, hours, months, years, and abbreviations),
      next ...,
      last ...,
      several month, day, and year arrangements,
      h:m[:s] specifications,
      and a few other things.
      Not all of these can be combined with prefixes and there is still a lot
      of missing support for gnu date compatibility.  In particular the
      handling of TZ= timezone specifications is mis-applied and support for
      the "Z" suffix is missing.
      Localization is still not properly supported for weekday and month names.
    * Appears to fix easy-rsa (part of the openvpn package), though easy-rsa
      still has an unrelated openssl/libressl issue.

Summary of changes:
 bin/date/date.1 |  21 ++++-
 bin/date/date.c |  28 +++++-
 bin/date/vary.c | 283 ++++++++++++++++++++++++++++++++++++++++++--------------
 bin/date/vary.h |   2 +-
 4 files changed, 260 insertions(+), 74 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list