Skip to main content
added 130 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

On an OpenBSD system:

$ stat -f '%Sm' myfile
Apr 12 09:40:05 2018 

The %Sm format means "modification time (m), as a string (S)".

Without the S, you'll get a Unix timestamp:

$ stat -f '%m' myfile
1523518805

These are the equivalents of %y and %Y with GNU stat -c "FORMAT" apart from the slight difference in the %y format output.

On an OpenBSD system:

$ stat -f '%Sm' myfile
Apr 12 09:40:05 2018 

The %Sm format means "modification time (m), as a string (S)".

Without the S, you'll get a Unix timestamp:

$ stat -f '%m' myfile
1523518805

On an OpenBSD system:

$ stat -f '%Sm' myfile
Apr 12 09:40:05 2018 

The %Sm format means "modification time (m), as a string (S)".

Without the S, you'll get a Unix timestamp:

$ stat -f '%m' myfile
1523518805

These are the equivalents of %y and %Y with GNU stat -c "FORMAT" apart from the slight difference in the %y format output.

Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

On an OpenBSD system:

$ stat -f '%Sm' myfile
Apr 12 09:40:05 2018 

The %Sm format means "modification time (m), as a string (S)".

Without the S, you'll get a Unix timestamp:

$ stat -f '%m' myfile
1523518805