Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting oh-my-zsh 'history' to display command date and time

Tags:

oh-my-zsh

The .zshrc has the following lines:

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"

But uncommenting and running history does not work.

like image 938
Guy Avatar asked Oct 11 '18 08:10

Guy


1 Answers

The .zshrc comment text is misleading.

Use:

HIST_STAMPS="%d/%m/%y %T"

To show day, month, year and time respectively.

like image 114
Guy Avatar answered Oct 17 '22 08:10

Guy