in reply to golfing on localtime

Hi ForgotPasswordAgain,

Is this the kind of thing you're looking for ...?

+ # Golfed generation of current date/time @t=map{$_+{4,1,5,1900}->{5-$i++}}(reverse localtime)[3..8]; + # Print the date/time printf "%d-%d-%d %02d:%02d:%02d\n", @t;

Update:  Or even shorter (55 chars):

@t=map$_+{1,1,0,1900}->{$i++},(localtime)[5,4,3,2,1,0];

(Update:  Fixed typos in the above line).


s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: golfing on localtime
by ForgotPasswordAgain (Vicar) on Jul 19, 2006 at 08:26 UTC
    Ha, yes that's brilliant.