Skip Menu |

This queue is for tickets about the Tk-Clock CPAN distribution.

Report information
The Basics
Id: 35664
Status: resolved
Priority: 0/
Queue: Tk-Clock

People
Owner: HMBRAND [...] cpan.org
Requestors: michael.j.tosh [...] lmco.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.23



Subject: Cannot show multiple timezones
Date: Tue, 06 May 2008 11:30:17 -0400
To: bug-Tk-Clock [...] rt.cpan.org
From: "Tosh, Michael J" <michael.j.tosh [...] lmco.com>
Using the code below, and much shorter versions, I was unable to display 2 clocks displaying multiple timezones. I would have expected to. Each clock instance uses the timeZone setting from the first. If I rearrange and put Etc/UTC first, all 3 clocks use that. Thanks, Mike <code> #!/usr/bin/perl -w use Tk; use Tk::Clock; my $MW1=MainWindow->new(); my $clock1 = $MW1->Clock(); $clock1->config( useDigital => 1, useAnalog => 0, timeZone => "America/New_York"); $clock1->pack( expand => 1, fill => "both" ); my $clock2 = $MW1->Clock(); $clock2->config( useDigital => 1, useAnalog => 0, timeZone => "Etc/UTC"); $clock2->pack( expand => 1, fill => "both" ); my $clock3 = $MW1->Clock(); $clock3->config( useDigital => 1, useAnalog => 0, timeZone => "America/Los_Angeles" ); $clock3->pack( expand => 1, fill => "both" ); MainLoop(); </code>
Show quoted text
> Using the code below, and much shorter versions, I was unable to > display 2 clocks displaying multiple timezones.
if you use strict, it would not run at all. All your pack statements are wrong. "expand" => "-expand", "fill" => "-fill". Show quoted text
> I would have expected to. Each clock instance uses the timeZone > setting from the first. If I rearrange and put Etc/UTC first, > all 3 clocks use that.
I rewrote your code to the code below, which is basically the same. I just added another font, and fixed the pack syntax: --8<--- <code> #!/usr/bin/perl use strict; use warnings; use Tk; use Tk::Clock; my $MW1 = MainWindow->new (); my @c = ( useDigital => 1, useAnalog => 0, timeFont => "{misc fixed} 8", dateFont => "{misc fixed} 8", ); my @p = (-expand => 1, -fill => "both"); my $clock1 = $MW1->Clock (); $clock1->config (@c, timeZone => "America/New_York"); $clock1->pack (@p); my $clock2 = $MW1->Clock (); $clock2->config (@c, timeZone => "Etc/UTC"); $clock2->pack (@p); my $clock3 = $MW1->Clock (); $clock3->config (@c, timeZone => "America/Los_Angeles"); $clock3->pack (@p); MainLoop (); -->8--- </code> And it showed me 3 different times. See attached screenshot. So, either you have a bug in your timezones, or you might run into some other weird problem, that is most likely nott in Tk::Clock Snapshot created with This is perl, v5.10.0 built for i686-linux-64int # perl -d:Modlist xx.pl AutoLoader 5.64 Carp 1.08 Carp::Heavy Config Cwd 3.2701 DynaLoader 1.08 Encode 2.24 Encode::Alias 2.08 Encode::Config 2.05 Encode::Encoding 2.05 Exporter 5.62 Exporter::Heavy 5.62 File::Spec 3.2701 File::Spec::Unix 3.2701 Symbol 1.06 Tk 804.028 Tk::After 4.007 Tk::Canvas 4.012 Tk::Clock 0.22 Tk::CmdLine 4.007 Tk::Configure 4.008 Tk::Derived 4.010 Tk::Event 4.019 Tk::Event::IO 4.008 Tk::Frame 4.010 Tk::Image 4.011 Tk::MainWindow 4.013 Tk::Pretty 4.006 Tk::Submethods 4.005 Tk::Toplevel 4.006 Tk::Widget 4.033 Tk::Wm 4.015 XSLoader 0.08 base 2.13 bytes 1.03 integer 1.00 vars 1.01 warnings 1.06 warnings::register 1.01
Download TkClock.jpg
application/octet-stream 5k

Message body not shown because it is not plain text.

Subject: RE: [rt.cpan.org #35664] Resolved: Cannot show multiple timezones
Date: Wed, 07 May 2008 09:15:04 -0400
To: bug-Tk-Clock [...] rt.cpan.org
From: "Tosh, Michael J" <michael.j.tosh [...] lmco.com>
Must be a problem with my Tk or Perl. I still see the problem using your code too. All 3 clocks say 09:01:15 (now). I'm running 5.8.3 with $Tk::VERSION = '800.024'. Can't upgrade to 804.028, getting errors. And I see the Tk::Clock.pm doesn't call out the ability to add the timezone display to the date/time format, do you know of a shortcut? Can I just use a Z or tz in the format string? Thank you for rewriting and checking my code over. Show quoted text
-----Original Message----- From: HMBRAND via RT [mailto:bug-Tk-Clock@rt.cpan.org] Sent: Tuesday, May 06, 2008 6:12 PM To: Tosh, Michael J Subject: [rt.cpan.org #35664] Resolved: Cannot show multiple timezones <URL: http://rt.cpan.org/Ticket/Display.html?id=35664 > According to our records, your request has been resolved. If you have any further questions or concerns, please respond to this message.
Subject: Re: [rt.cpan.org #35664] Resolved: Cannot show multiple timezones
Date: Wed, 7 May 2008 15:37:09 +0200
To: bug-Tk-Clock [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Wed, 07 May 2008 09:15:39 -0400, "Tosh, Michael J via RT" <bug-Tk-Clock@rt.cpan.org> wrote: Show quoted text
> Must be a problem with my Tk or Perl. I still see the problem using > your code too. All 3 clocks say 09:01:15 (now). I'm running 5.8.3 with > $Tk::VERSION = '800.024'. Can't upgrade to 804.028, getting errors.
800.024 is really old. What are the errors you get on 804.028? What OS? Why still 5.8.3? Does your OS correctly support time zones at all? $ env TZ=America/New_York date Wed 7 May 2008 09:36:25 EDT $ env TZ=Europe/Amsterdam date Wed 7 May 2008 15:36:25 CEST $ env TZ=Asia/Singapore date Wed 7 May 2008 21:36:25 SGT Show quoted text
> And I see the Tk::Clock.pm doesn't call out the ability to add the > timezone display to the date/time format, do you know of a shortcut?
No, none is supported. And it wouldn't be useful, as $TZ is usually long, and would not fit the given space. Show quoted text
> Can I just use a Z or tz in the format string?
No, not supported. Show quoted text
> Thank you for rewriting and checking my code over.
Welcome. -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
Subject: RE: [rt.cpan.org #35664] Resolved: Cannot show multiple timezones
Date: Wed, 07 May 2008 09:44:45 -0400
To: bug-Tk-Clock [...] rt.cpan.org
From: "Tosh, Michael J" <michael.j.tosh [...] lmco.com>
Quoting h.m.brand@xs4all.nl via RT: Show quoted text
> > Must be a problem with my Tk or Perl. I still see the problem using > > your code too. All 3 clocks say 09:01:15 (now). I'm running 5.8.3 > > with $Tk::VERSION = '800.024'. Can't upgrade to 804.028, getting > > errors.
> > 800.024 is really old. What are the errors you get on 804.028?
Cannot make without successful test. Cannot find -lX11. Show quoted text
> What OS?
SuSE 9 SLES PPC Show quoted text
> Why still 5.8.3?
Bugzilla doesn't work well with 5.10. Primary function of it is to support Bugzilla development/testing. Show quoted text
> Does your OS correctly support time zones at all?
Yes Show quoted text
> $ env TZ=America/New_York date > Wed 7 May 2008 09:36:25 EDT > $ env TZ=Europe/Amsterdam date > Wed 7 May 2008 15:36:25 CEST > $ env TZ=Asia/Singapore date > Wed 7 May 2008 21:36:25 SGT
tosh $ env TZ=America/New_York date Wed May 7 09:40:54 EDT 2008 tosh $ env TZ=Europe/Amsterdam date Wed May 7 15:41:01 CEST 2008
Subject: Re: [rt.cpan.org #35664] Resolved: Cannot show multiple timezones
Date: Wed, 7 May 2008 16:30:35 +0200
To: bug-Tk-Clock [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Wed, 07 May 2008 09:45:20 -0400, "Tosh, Michael J via RT" <bug-Tk-Clock@rt.cpan.org> wrote: Show quoted text
> > Queue: Tk-Clock > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=35664 > > > Quoting h.m.brand@xs4all.nl via RT:
> > > Must be a problem with my Tk or Perl. I still see the problem using > > > your code too. All 3 clocks say 09:01:15 (now). I'm running 5.8.3 > > > with $Tk::VERSION = '800.024'. Can't upgrade to 804.028, getting > > > errors.
> > > > 800.024 is really old. What are the errors you get on 804.028?
> Cannot make without successful test. Cannot find -lX11.
install package xorg-x11-libX11-devel with YaST2 Show quoted text
> > What OS?
> > SuSE 9 SLES PPC
I'm on OpenSUSE 10.3 myself, but still have 10.2 and 10.1 available Show quoted text
> > Why still 5.8.3?
> > Bugzilla doesn't work well with 5.10. Primary function of it is to > support Bugzilla development/testing.
I don't want you to skip to 5.10 now, but to update to 5.8.8 Show quoted text
> > Does your OS correctly support time zones at all?
> Yes > > tosh $ env TZ=America/New_York date > Wed May 7 09:40:54 EDT 2008 > tosh $ env TZ=Europe/Amsterdam date > Wed May 7 15:41:01 CEST 2008
That is good, as this is exactly what Tk::Clock is doing internally. So the bug is most likely in some OS library itself. What does this perl code show? --8<--- use strict; use warnings; foreach my $tz (qw( America/New_york Europe/Amsterdam America/Los_Angeles )) { local $ENV{TZ} = $tz; print ~~ localtime, "\t$tz\n"; } -->8--- Wed May 7 13:59:17 2008 America/New_york Wed May 7 15:59:17 2008 Europe/Amsterdam Wed May 7 06:59:17 2008 America/Los_Angeles Just tested the above on my 10.3, and it worked for both 5.8.3 and 5.8.8 -- H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
Lack of feedback makes me suggest that it was indeed fixed