Browse the docs

mailDateReceived

Returns when the selected message was received, as a time in seconds since 1 January 1970.

Keyboard Maestro: MAILDATERECEIVED

Details #

mailDateReceived() takes no arguments and returns a number: when the selected message was received, as a time in seconds since 1 January 1970.

Parameters #

Takes 0 arguments. {{ mailDateReceived() }}

Examples #

mailDateReceived()
→ 0
kmDateTime("yyyy-MM-dd HH:mm", "for", mailDateReceived())
→ 1969-12-31 18:00

Gotchas #

  • Needs Automation permission for Mail. It reads the first selected message in Mail; when Mail isn't running, nothing is selected or Mail doesn't answer within about 5 seconds, the answer is 0.

  • The time is a number: format it with kmDateTime using the "for" mode, for example kmDateTime("yyyy-MM-dd", "for", mailDateReceived()).

  • Takes no arguments.