[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mktime() and invalid dates
From: |
Aharon Robbins |
Subject: |
Re: mktime() and invalid dates |
Date: |
Sun, 25 Apr 2010 23:03:00 +0300 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
> From address@hidden Sun Apr 25 20:37:38 2010
> Return-Path: <address@hidden>
> X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sls-af11p1
> X-Spam-Level:
> X-Spam-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,
> DNS_FROM_OPENWHOIS,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.5
> X-Envelope-From: address@hidden
> X-Envelope-To: <address@hidden>
> X-Authenticated: #11822790
> X-Provags-ID: V01U2FsdGVkX1+Zs1leaMaZczOc440x9NC6N4K40ZiVuJ+lJMVAkt
> enACSm5qnuSJFH
> Date: Fri, 23 Apr 2010 14:29:53 +0200
> From: Hermann Peifer <address@hidden>
> To: address@hidden
> Subject: mktime() and invalid dates
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> X-Y-GMX-Trusted: 0
> X-FuHaFi: 0.67000000000000004
> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
> recognized.
> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3)
> Status: R
>
> Hi Arnold,
>
> mktime() doesn't seem to potest in case of invalid dates, e.g.
>
> gawk 'BEGIN{ print mktime("2010 03 32 25 61 61")
> print mktime("2010 04 02 02 02 01")
> }'
> 1270166521
> 1270166521
>
>
> I am not sure if this is a bug or rather a feature.
>
> Hermann
>
Fixed in my development version (which might not yet be in CVS):
$ ./gawk 'BEGIN{ print mktime("2010 03 32 25 61 61")
> print mktime("2010 04 02 02 02 01")
> }'
-1
1270162921
Thanks!
Arnold