How to change the time format used by ls command line on osx

command lineunix

I want to make ls display time in ISO format (military format). How can I change this behavior?

On Linux I knew that I could force ls to display time in long format by usin --full-time but this doesn't work on OS X.

Update: I know that the format used by the command is based on the locale settings. The problem is that on OS X I was not able to use the trick of setting LC_TIME=en_DK.

Best Answer

If you install gnu coreutils then gnu ls is available, which will do as required. If you use brew as a package manager, it's as simple as:

brew install coreutils
gls -l --time-style=full-iso