Herbert Xu wrote:
> Jeff Waugh <[EMAIL PROTECTED]> wrote:
> > I was hoping to receive a few more contributions! :)
>
> OK, can't leave gawk out can we,
> gawk 'BEGIN { print strftime("%c", 10^9) }'
------------------------------------------------
This is really a scripting job.
MySQL is handy for quick numeric calcs, but giga seconds is messy:
mysql -e 'select FROM_UNIXTIME(1000000000,"%a %b %e %T %Y") giga_second'
------------------------------------------------
The C solution is verbose, clunky, and takes Real Programming:
echo -e "#include <time.h>\n#include <stdio.h>\nint main() { time_t const t = 1e9;
printf(\"%s\",ctime(&t)); return 1;
}">s.c | gcc s.c; ./a.out
As always, trojan-check source code. The above could have read:
echo -e "#include <nefarious.h>\nint main() { return awful_crack(); }">s.c | gcc s.c;
./a.out
Tomorrow, the C++ version, if line length allows.
--
Rick Welykochy || Praxis Services Pty Limited
"Tired of being a crash test dummy for Microsoft? Try Linux"
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug