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*

4
  • 3
    To get this feature on OSX I finally got the GNU tools: $ brew install coreutils ; gdate --iso-8601 -d "yesterday 12:00" Commented Jul 5, 2018 at 18:51
  • 23
    @AnneTheAgile for macOS, you can manually format the date like so: "date +%Y-%m-%dT%H:%M:%S%z" Commented Apr 23, 2019 at 12:47
  • 3
    I feel like the top answers are pretty complicated considering that date -Iseconds seems to "just work" on all platforms Commented Oct 4, 2022 at 17:46
  • in 2023 date -I is working at UBUNTU Commented Apr 18, 2023 at 21:25