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");