[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl & timelocal....



Help!!

I can't get timelocal to work on my mac(s)
It works on on my sun.
It's the very recent download... system 7.5.5 mac IIfx & more...

here's my test:

#!/home/johnh/BIN/perl5 -w

require "timelocal.pl";

# prints :
# raw local time is 03/07/1997 13:12:24 5 65 0
# timelocal = ffffffff
# ... on my mac.
# prints :
# printf (...) interpreted as function at timelocal.pl line 8.
# raw local time is 03/07/1997 13:13:18 5 65 0
# timelocal = 332084ee
# ... on my sun


 @timearray = localtime(time);
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = @timearray;
 printf ("raw local time is %02d/%02d/%04d %02d:%02d:%02d %d %d %d\n",
          $mon+1,$mday,1900+$year,$hour,$min,$sec,$wday,$yday,$isdst);
 $ltime = &timelocal(@timearray);
 printf ("timelocal = %8x\n",$ltime);