GnuPG - Creation and Expiration timestamp

How can I see the creation and expiration timestamp of my keys?
With --list-key I only see the date without time.

If you want the time in addition to the date, I guess that only of the debugging options may help, but I am not sure.

You can use:
gpg -a --export <email-adress_or_id> | gpg --list-packets
to get the creation time as seconds since unix epoch (look for “created” in the output)
(https://stackoverflow.com/questions/48914338/how-to-get-expiration-date-from-a-gpg-key/48915209#48915209)

There is also a line with “key expires after” which shows the the whole duration from creation to expiration. You would have to calculate the exact expiration time but that should be no problem :wink:

Two other solutions were mentioned in the mailinglist:

the option --with-colons

--full-timestrings (since  2.3.0)

https://lists.gnupg.org/pipermail/gnupg-users/2023-January/066380.html