UNIX epoch conversion

From Brandonhutchinson.com

Revision as of 19:51, 26 September 2007 by Hutch (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Days since the UNIX epoch

Return the number of days since the UNIX epoch using perl:

$ perl -e 'printf qq{%d\n},time/86400'

Convert /etc/shadow lastchg to date

Convert the lastchg field in /etc/shadow to a date using GNU date:

$ date -d "1 January 1970 + lastchg days"


Personal tools