I would like to know the precise creation time of a ZFS snapshot. Note that I am not referring to the timestamp in the snapshot name itself but the result of querying the creation
property when using zfs get creation mysnapshot
The default formatting only shows precision up to the minute:
root@truenas[~]# zfs get creation tank1/home@auto-hourly-20240717T180000:0200
NAME PROPERTY VALUE SOURCE
tank1/home@auto-hourly-20240717T180000:0200 creation Wed Jul 17 18:00 2024 -
As we can see in this example, it displays Wed Jul 17 18:00 2024
.
Is there a way to display the seconds? Or to fully configure the datetime format (e.g. ISO 8601)?
The use of argument -p
(Display numbers in parsable (exact) values.) returns the epoch which is easily convertible in the full time including seconds.
root@truenas[~]# zfs get -p creation tank1/home@auto-hourly-20240717T180000:0200
NAME PROPERTY VALUE SOURCE
tank1/home@auto-hourly-20240717T180000:0200 creation 1721232000 -