UNIX epoch conversion

From Brandonhutchinson.com

(Difference between revisions)
Jump to: navigation, search
(New page: === 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 ...)
Current revision (19:51, 26 September 2007) (edit) (undo)
 

Current revision

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"

Links

Personal tools