Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zsh: strftime command not found

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.

like image 494
nocksock Avatar asked Apr 18 '10 11:04

nocksock


1 Answers

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
like image 82
Dennis Williamson Avatar answered Sep 21 '22 10:09

Dennis Williamson