Automator Service: Copy Current UTC Timestamp to Clipboard

Yeah, I know, you're probably getting sick of these Automator services. But I really do create a new one of these practically every day to make my life a little easier, and maybe some of these will be useful to others.

This one puts a UTC timestamp on the clipboard. The timestamp is an ISO 8601-format string like "2009-11-09T13:14:03Z". If you'd like a different format, type "man date" in Terminal to see how to change the output format of the date command in the shell script below.

How to Use It

Choose Copy Current UTC Timestamp to Clipboard from the Services menu, then paste it into wherever you need it.

How to Make it

  1. Start up Automator, and create a new Service which takes no input in any application
  2. Add a Run Shell Script action, with shell /bin/bash and which passes input to stdin. Replace the shell script text with this:

    /bin/date -u '+%FT%TZ'
  3. Add a Copy to Clipboard action.
  4. Choose File -> Save and name it "Copy Current UTC Timestamp to Clipboard"

Screenshot

© 2003-2023 Kristopher Johnson