I'm trying to add a timestamp to the beginning of my bash prompt in the format of a 12 hour HH:MM:SS AM/PM clock, and as of now, I've had no luck. Here's a couple things I've tried.I've tried date +%r but that only updates each time my ~/.bashrc is reloaded.I've tried \D{%T} but that displays 24-hour time.I've tried \@ but that only displays HH:MM AM/PM.I've tried \t but that displays 24-hour time.I've tried \T but that does not show AM/PM.Am I missing something, or is there some way to do this?
HH:MM:SS (with AM/PM) 12 Hour Timestamp for Bash Prompt
bash;date;prompt
\D{%r} displays 12 hour time in the HH:MM:SS AM/PM format.