Skip Menu |

This queue is for tickets about the Class-Date CPAN distribution.

Report information
The Basics
Id: 1734
Status: resolved
Worked: 3 hours (180 min)
Priority: 0/
Queue: Class-Date

People
Owner: dlux [...] dlux.hu
Requestors: bill.smith [...] jhuapl.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.1.1
Fixed in: (no value)



Subject: Timezone not computed correctly in Solaris
I posted about this problem earlier in the month to the mailing list. I'll include my initial email as well as some sample code at the bottom. The response I received back was that the timezone seemed to not be computed correctly on solaris. My workaround was to hardcode the timezone into the script which in my case was EST. Bill I just installed the latest version of the class::date module and ran into a | problem with a script which is referencing it. At 12:01 AM each day I had a | script kick off which computed the date at that time and created a file | based on the date in dd-mm-yyyy format. I computed the current date using | the now call. Since installing the new version when using now it returns | the previous day as the current date. If the script runs about 5 hours later | the expected date is returned. I see my problem is that the date is | returned in GMT. I need to return it in EST. What code do I need to add to | my script in order to set the timezone to be EST so that when I run this | script at 12:01 it returns the correct date and not the previous one. use Class::Date qw(:errors date localdate gmdate now); local $Class::Date::DATE_FORMAT="%m-%d-%Y"; $LOGDIR="/flow/logs"; $BINDIR="/flow/bin"; chdir $LOGDIR or die "Could not chdir to $LOGDIR $!"; $a = system("pkill fdget"); print ("Value is $a\n"); $curdate = now; #$prevday = now- '1D'; system("$BINDIR/fdget 2001 >> $LOGDIR/$curdate &"); #system("sleep 3600"); #system("gzip -9 $prevday");
RT-Send-CC: bill.smith [...] jhuapl.edu
Please try the next version of Class::Date, from http://hack.dlux.hu/Class-Date I have found a bug in the strftime implementation of perl 5.8.0 and earlier versions, it might solve the problem.
[DLUX - Sat Dec 14 17:35:12 2002]: Show quoted text
> Please try the next version of Class::Date, from > http://hack.dlux.hu/Class-Date > > I have found a bug in the strftime implementation of perl 5.8.0 and > earlier versions, it might solve the problem.
Sorry, the correct URL: http://hacks.dlux.hu/Class-Date
From: bill.smith [...] jhuapl.edu
I got your update. When I attempted to install the latest version via cpan I got a message saying I was running the latest version. I then did an "i class::date" and had returned what follows the text here. According to this I'm running the cpan version 1.0 but install version 1.1.1. Am I actually running what you would consider version 1.1.1? If so, it seems the problem I was having is fixed. I'm including the original code below the script info output again where you'll notice 1 item commented out. That had to be uncommented originally. All in all, it appears my problem is fixed. I"ll look again and post otherwise though but all is good now I believe! Thanks for your help! Strange distribution name [Class::Date]Module id = Class::Date DESCRIPTION A full-featured date and time class for perl CPAN_USERID DLUX (Szabo, Balazs <dlux@kapu.hu>) CPAN_VERSION 1.0 CPAN_FILE D/DL/DLUX/Class-Date-1.0.10.tar.gz DSLI_STATUS RdhO (released,developer,hybrid,object-oriented) MANPAGE Class::Date - Class for easy date and time manipulation INST_FILE /usr/local/lib/perl5/site_perl/5.6.1/sun4- solaris/Class/Date.pm INST_VERSION 1.1.1 use Class::Date qw(:errors date localdate gmdate now); local $Class::Date::DATE_FORMAT="%m-%d-%Y"; #local $Class::Date::DEFAULT_TIMEZONE='EST'; $LOGDIR="/flow/logs"; $BINDIR="/flow/bin"; chdir $LOGDIR or die "Could not chdir to $LOGDIR $!"; system("pkill fdget"); $curdate = now; print ("Cur date is $curdate\n"); $prevday = now - '1D'; print ("Prev date is $prevday\n"); system("$BINDIR/fdget 2001 >> $LOGDIR/$curdate &"); system("sleep 3600"); system("gzip -9 $prevday"); [DLUX - Sat Dec 14 17:36:26 2002]: Show quoted text
> [DLUX - Sat Dec 14 17:35:12 2002]: >
> > Please try the next version of Class::Date, from > > http://hack.dlux.hu/Class-Date > > > > I have found a bug in the strftime implementation of perl 5.8.0 and > > earlier versions, it might solve the problem.
> > Sorry, the correct URL: http://hacks.dlux.hu/Class-Date
Hi, According to your last comment, I'll set this issue to resolved. Cheers, Balázs