help with perl

From: Rakesh Jain <jain_at_pascal.physics.smu.edu>
Date: Fri, 24 Oct 1997 01:07:20 -0500 (CDT)

hi there,

        I am trying to use the date function in perl and the value of
        the month seems to be wrong. Can anyone help me.
        I am running perl 5.0 patch 2 verison on alpha 3.2c. of dunix.

---------perl code I used-------
#!/usr/local/bin/perl
#

local ($sec, $min, $hour, $day, $month, $year, $wday, $yday, $isdst)
        = localtime();

$ad_update = "$month/$day/$year";
print "Ad Last updated = $ad_update \n";
print "all the values = sec, min, hour, day, month, wday, yday, isdst \n";
print "all the values = $sec, $min, $hour, $day, $month, $wday, $yday, $isdst \n";

exit(0);

----------------------------
output I get:

Ad Last updated = 9/24/97
all the values = sec, min, hour, day, month, wday, yday, isdst
all the values = 4, 3, 1, 24, 9, 5, 296, 1

Ad when I use system date from prompt I get:

% date
Fri Oct 24 01:06:12 CDT 1997

so somewhere there is a problem.


Thanks for all your help.

rakesh
Received on Fri Oct 24 1997 - 08:19:15 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT