You can use the strftime function to do this:
if exists('*strftime')
au BufNewFile *.py :call append(0, '# Created: '.strftime('%a, %d %b %Y %T %z'))
endif
According to the documentation, strftimenot on some systems. See man strftime(if you are on * nix) for details on the format.
source
share