You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Erwin De Wolff <er...@hermes.si> on 2003/02/11 14:05:34 UTC
question about imploding/exploding time
Using platform windows XP, APR library version 0.9.2.
I wonder if it is correct to get the result:
apr_time_exp_tz(&test, 0, 0);
the month 0, (zero? not 01 ?!?)
year 70 (I understand that)
day 1
etc.
It seems that it is the number of microseconds since 01-00-1970 00:00:00 GMT
(month 00). Is that on purpose done or a bug?
On the other hand 01-01-1970 00:00:00 GMT and implode it gives 2678400000000
which is 31 one days in microseconds. So it is consistent at least.
If it is meant like this I can easily correct it, but I don't see a reason
for this.
Greetings
Erwin de Wolff
Re: question about imploding/exploding time
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
The reason is that apr_time_exp_* functions explode and implode
the same epoch as unix (1/1/70 midnight). As with all Unix time
functions, months are counted from 0 (Jan).
This assures that time constants are portable from platform to
platform.
Bill
At 07:05 AM 2/11/2003, Erwin De Wolff wrote:
>Using platform windows XP, APR library version 0.9.2.
>
>I wonder if it is correct to get the result:
>
>apr_time_exp_tz(&test, 0, 0);
>the month 0, (zero? not 01 ?!?)
>year 70 (I understand that)
>day 1
>etc.
>It seems that it is the number of microseconds since 01-00-1970 00:00:00 GMT
>(month 00). Is that on purpose done or a bug?
>On the other hand 01-01-1970 00:00:00 GMT and implode it gives 2678400000000
>which is 31 one days in microseconds. So it is consistent at least.
>
>If it is meant like this I can easily correct it, but I don't see a reason
>for this.
>
>Greetings
>
>Erwin de Wolff