# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.288 2023/07/04 13:58:01 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.289 2023/07/04 14:41:26 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
my ($year, $month, $day, $hour, $min, $sec) =
($1 - 1900, $2-1, $3, $4, $5, $6);
require POSIX;
- my $oldtz = $ENV{TZ};
- $ENV{TZ} = 'UTC';
+ local $ENV{TZ} = 'UTC';
my $t = POSIX::mktime($sec, $min, $hour, $day, $month, $year);
- if (defined $oldtz) {
- $ENV{TZ} = $oldtz;
- } else {
- delete $ENV{TZ};
- }
return $t;
} else {
die "Incorrect ISO8601 timestamp: $s";