Zfs: ZFS snapshots between midnight and 1 AM are missing a padded zero in the creation propery

Created on 1 Mar 2020  路  6Comments  路  Source: openzfs/zfs

System information

Distribution Name | Proxmox
Distribution Version |
Linux Kernel | 5.3.10-1-pve
Architecture | x86_64
ZFS Version | 0.8.2-pve2
SPL Version | 0.8.2-pve2

Describe the problem you're observing

The creation property on snapshots is missing the trailing zero when the hour is midnight.

Describe how to reproduce the problem

zfs create tank/users
Between 00:00 and 00:59 hours, do:

zfs snapshot tank/users@mysnapshot
zfs get creation -o value -H tank/users@mysnapshot
Tue Feb 25  0:06 2020

Notice the hours are 0:06
It should be 00:06.

This wreaks havoc on every date parser I can think to use and every format string I can come up with.

This problem may exist elsewhere in date outputs, but I'm currently running into this one.

Defect good first issue

All 6 comments

Oh my why isn't this in ISO format...

Well...there is that...but I'll take whatever reasonable date format I can get. :)

zfs get -p

I completely missed the -p arg in the docs. Thanks!

Should this be closed since the -p option is available? While the default output format is ugly I'm not entirely sure if it's a bug or not.

I would say both the original question and -p need to be better documented.

I can't tell what format "creation" is supposed to be in (and if its configurable somewhere), and I also can't tell what units it is if -p is specified (although I can guess)

I'd like to see the missing zero padding added if anyone wants to tackle this. I agree it's jarring to read. And documentation improvements for -p would be welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

torn5 picture torn5  路  57Comments

allanjude picture allanjude  路  72Comments

pruiz picture pruiz  路  60Comments

pwolny picture pwolny  路  102Comments

user318 picture user318  路  51Comments