NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: question about strptime on NetBSD 6 stable



In article <1361323947.52794%da3m0n8t3r.com@localhost>,
Waitman Gobble <uzimac%da3m0n8t3r.com@localhost> wrote:
>
>It seems like strptime is ignoring %z on NetBSD 6 stable? Or maybe i'm
>doing it wrong.

mktime(3) uses the "local time" to convert struct tm * to time_t. This
means that while strptime(3) takes into account the tzoffset and sets
tm->tm_gmtoff correctly, this field is not taken into account by mktime(3)
since doing so would violate the standard. Depending on the timezone you
have set, you are going to see different results; perhaps this is why you
think that the other OS is correct :-)

NetBSD provides extensions such as mktime_z() that control which timezone
is used on a call by call basis, instead of relying on the environment.

christos



Home | Main Index | Thread Index | Old Index