Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 31
    Comments must be at the least 15 words in length. date -I Commented Oct 15, 2020 at 5:12
  • 40
    Indeed date -I is all you need. It took me years to stumble upon that. Commented Mar 15, 2021 at 23:28
  • 9
    date -I only works on Linux using GNU tools, not on macOS / BSD; installing brew --> brew install coreutils makes gdate -I available Commented Jul 29, 2021 at 18:05
  • date -r <TIMESTAMP> -I works fine under the BSD tools FWIW. Commented Jan 23, 2024 at 20:01
  • 6
    2024 update - date -I now works on macOS Commented Apr 13, 2024 at 9:27