0

I want to change date format of last reboot time. How can I do this? Any idea ? I cut the other things from last reboot command. The last seems :

Output :  1 Nov 2015

But I want like this :

dd/mm/yyyy : 01/11/2015
2
  • from which command you are getting date ? Commented Nov 1, 2015 at 17:50
  • using "last -F reboot" @AmeyJadiye Commented Nov 1, 2015 at 17:51

1 Answer 1

1

Since you already cut the output you just have to convert it to different format, try below you will find your expected format.

export DATE="1 Nov 2015"
date -d"$DATE" +%d/%m/%Y
01/11/2015
Sign up to request clarification or add additional context in comments.

2 Comments

I have been done this. But I want to ask is tehere a way change format of last reboot time's format ? a=$(last -F reboot etc... ) --->this is my command and then I print "a". but the date is not a good way for me
nops, there is no option given by last to change date format, one thing you can do is to change the code of last pkg, recompile and install patch to your OS, but this is very long process :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.