UNIX epoch conversion

From Brandonhutchinson.com

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