days since 1970

How can I get the syatem to give me the days since 1970 (as seen in the shadow file)?

perl �-e �'�$days=int(time()/86400); ���print $days;�'
will do the trick.

[Edited by mib on 04-17-2001 at 01:32 PM]

Hmmm. I tried the perl command for fun and got:

www# perl  -e  ' $days=int(time()/86400);    print $days; '
www# www# 

Maybe missing a \n (newline)?

perl -e ' $days=int(time()/86400);print "$days\n"; '

is slightly more correct, but the example given should work (and does for me).

Or save a variable and do:
perl -e 'print int(time()/86400)."\n"'

Or do it in your shell:

let a=`date +%s`/86400 ; echo $a

(requires GNU date)

[Edited by PxT on 04-18-2001 at 01:59 PM]

Works on our linux platforms with the newline:

www# perl -e ' $days=int(time()/86400);print "$days\n"; '