]> Sergey Matveev's repositories - dotfiles.git/commitdiff
zsh built-in strftime
authorSergey Matveev <stargrave@stargrave.org>
Sun, 13 Feb 2022 18:30:25 +0000 (21:30 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 13 Feb 2022 18:30:25 +0000 (21:30 +0300)
bin/bin/zsnap.zsh

index 0182a53c7575d6142c2f9445042710f06be3c078..67fff3c5bba62dfbf4e238f74d0e98f9fa37201a 100755 (executable)
@@ -21,7 +21,8 @@ enccmd=(~stargrave/bin/gpg-e-fast.sh --recipient offline)
 what=$1
 action=$2
 
-now=$(date "+%Y%m%d%H%M")
+zmodload -F zsh/datetime b:strftime
+now=$(strftime %Y%m%d%H%M)
 [[ $what =~ / ]] && depth=1 || depth=${#${(s./.)what}}
 snaps=$(zfs list -t snap -d $depth -o name -H | grep $what | sort -nr)
 snaps=(${(f)snaps})