5

I'm trying to get a formatted time output using a such command in Mac OS X 10.7.5 (in the Terminal app):

stat -f "%m" -t "%Y" "myfilename.jpg"

However, it still gives me a unixtime, not the formatted string:

1349690206

What I'm doing wrong?

1 Answers1

6

You have to add S for string output.

$ stat -f %Sm -t %Y file.txt
2012
Lri
  • 42,502
  • 8
  • 126
  • 159