Changing $ENV{TZ} and calling tzset() is documented not to work on Win32
in any thread other than the main thread, which includes the emulated
fork() on Win32 (used by cpantesters?). Mention fork() in the caveats and
skip the test in this case.
':override' => 'internal',
);
-our $VERSION = '1.14';
+our $VERSION = '1.14_01';
bootstrap Time::Piece $VERSION;
in the main thread to have the desired effect in this case (and you must
also call _tzset() in the main thread to register the environment change).
+Furthermore, remember that this caveat also applies to fork(), which is
+emulated by threads on Win32.
+
=head1 AUTHOR
Matt Sergeant, matt@sergeant.org
cmp_ok($t->daylight_savings, '==', 0);
# ->tzoffset?
-{
+my $is_pseudo_fork = 0;
+if (defined &Win32::GetCurrentProcessId
+ ? $$ != Win32::GetCurrentProcessId() : $^O eq "MSWin32" && $$ < 0) {
+ $is_pseudo_fork = 1;
+}
+SKIP: {
+ skip "can't register TZ changes in a pseudo-fork", 2 if $is_pseudo_fork;
local $ENV{TZ} = "EST5";
Time::Piece::_tzset(); # register the environment change
my $lt = localtime;