in reply to Re: Time and Date Output
in thread Time and Date Output

TVSET,
hmmm - I'm too lazy for that
perl -e 'print scalar localtime' > myfile.date
Just change the single quotes to double quotes if it is on Win32.

Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Re: Time and Date Output
by Fletch (Bishop) on Jul 20, 2003 at 11:13 UTC

    Bah, you call that lazy? :)

    $ date > myfile.date

    Even the perl version's shorter.

    $ perl -e 'print `date`' > myfile.date
      I am inclined to consider your laziness as false laziness. The problem is that while you type less characters, you cause the CPU to work more:
      use Benchmark; timethese(-2, { inhouse => sub { $_ = scalar localtime }, outsource => sub { $_ = `date` }, });

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      B--B--B--B--B--B--B--B--
      H---H---H---H---H---H---
      (the triplet paradiddle with high-hat)