How to Change Terminal Timestamp to Military Time?

0
5
Asked By CuriousCoder37 On

Hey everyone! I'm trying to modify the timestamp in my terminal to display in military time format. For example, instead of seeing something like [08:54 PM]-[jag@Mo], I want it to look like [2054]-[jag@mo]. Any suggestions on how to achieve this?

2 Answers

Answered By TechieGuru14 On

One way to get this done is by changing your locale to one that uses a 24-hour format. It might help align your terminal’s time display with what you're looking for.

HelpfulNerd22 -

Are you talking about the local system settings? Because mine already uses military time, but the terminal doesn’t reflect that.

Answered By ScriptingSavant01 On

You could try editing your .bashrc file. Just add something like ps1='[t] [jag@mo]' to set the format you want. It should work to show the time in military format.

TinkerTech99 -

I gave that a shot, but unfortunately, it didn’t work for me.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.