Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to work out the time from "time_last_login" 2

Status
Not open for further replies.

jpor

Technical User
Joined
Nov 29, 2000
Messages
212
Location
GB
Hi Guys,

Apologises in advance if this has already been covered. But couldn't find anything with a search.

How do you work out in dd/mm/yy the "time_last_login" from /etc/security/lastlog ?

I take it this is in Julien date format?

Thanks in advance.

( "To become Wise, first you must ask Questions")
 
The value of "time_last_login" is the number of second since 01/01/1970......
 
You can use this :

perl -wle 'print scalar localtime(eval shift);' XXX

Ex : perl -wle 'print scalar localtime(eval shift);' 1095691952

Returns :
Mon Sep 20 16:52:32 2004
 
Thanks guys. The perl script works like a charm.


( "To become Wise, first you must ask Questions")
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top