I am currently learning the zsh and now I wanted to use strftime
but i get:
zsh: command not found: strftime
I think I'm doin' something wrong, since I see people using that function all the time in their dotfiles.
strftime
is defined in a zsh
module called datetime
. The zmodload
command loads modules from a colon-separated list of directories in $module_path
.
On my system:
% echo $module_path
/usr/lib/zsh/4.3.10
% ls -l $module_path
drwxr-xr-x 3 root root 4096 2009-11-05 01:03 zsh
% ls -l $module_path/zsh/datetime*
-rw-r--r-- 1 root root 9828 2009-09-10 02:45 /usr/lib/zsh/4.3.10/zsh/datetime.so
% type -a strftime
strftime not found
% zmodload zsh/datetime
% strftime %Y-%m-%d 1271603087
2010-04-18
% type -a strftime
strftime is a shell builtin
% /bin/date -d @1271603087 +%Y-%m-%d
2010-04-18
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With