X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/c7c126d4579f3aea02a0800922a0d0994420f7ba..282625e1b87743236f1cb8c70c2762edd413c6b0:/getdate.y diff --git a/getdate.y b/getdate.y index a9de991..1a7c788 100644 --- a/getdate.y +++ b/getdate.y @@ -371,7 +371,7 @@ relunit : tUNUMBER tYEAR_UNIT { ; number : tUNUMBER - { + { if (yyHaveTime && yyHaveDate && !yyHaveRel) yyYear = $1; else @@ -393,8 +393,8 @@ number : tUNUMBER } else { - yyHour = $1 / 100; - yyMinutes = $1 % 100; + yyHour = $1 / 100; + yyMinutes = $1 % 100; } yySeconds = 0; yyMeridian = MER24; @@ -924,13 +924,13 @@ get_date (p, now) { /* Guard against falsely reporting errors near the time_t boundaries - when parsing times in other time zones. For example, if the min - time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead - of UTC, then the min localtime value is 1970-01-01 08:00:00; if - we apply mktime to 1970-01-01 00:00:00 we will get an error, so - we apply mktime to 1970-01-02 08:00:00 instead and adjust the time - zone by 24 hours to compensate. This algorithm assumes that - there is no DST transition within a day of the time_t boundaries. */ + when parsing times in other time zones. For example, if the min + time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead + of UTC, then the min localtime value is 1970-01-01 08:00:00; if + we apply mktime to 1970-01-01 00:00:00 we will get an error, so + we apply mktime to 1970-01-02 08:00:00 instead and adjust the time + zone by 24 hours to compensate. This algorithm assumes that + there is no DST transition within a day of the time_t boundaries. */ #ifndef GETDATE_IGNORE_TIMEZONE if (yyHaveZone)