How to Find: last login information in terms of year-month-date
Thanks
AVklinux |
Moin,
I'm not sure, if I understood your question. Do you mean this? Code:
last | cut -c1-9,40-56 | while read u d; do date -d "$d" +"$u %Y-%m-%d"; done |
thanks for answer.
can you tell me script to find the diff between 2 dates. like d1=2009-23-03 d2=2008-22-78 thanks avklinux |
Quote:
Example of UNIX time output: Code:
date -u +%s |
can u explain in terms of d1 and d2.
means d1=1236430420 and d2=1236430460 then how do i script it ...??? |
Code:
d1=1236430420 |
Moin,
Quote:
Code:
jan@jack:~/tmp> d1=2009-03-23 |
The Bash script below does basically what jan61's post above does. Input dates in the same format to get total days, hours, minutes between two dates.
Code:
#!/bin/bash 2009-03-05 10:45:30, get output: Days: 2 Hours: 8 Minutes: 15 Seconds: 15 Code:
#!/bin/bash |
All times are GMT -5. The time now is 11:59 AM. |