We use a date format that appends the day at the end of the date like so: 20180109tu@1730. Is there any way to get the two letter day format?

  • 1
    I'm voting to close this question as off-topic because it's about a C function, not Vi/Vim. – Herb Jan 9 '18 at 22:31
  • 4
    I don't think I agree with the placing-on-hold of this question. Whilst Vim's strftime() function may only be a thin wrapper around the C function, it still is a Vim function. Furthermore, it's certainly possible to answer the question using Vim alone: the OP has done so! – Rich Jan 10 '18 at 10:26
  • Seems pedantic but whatever works. – Mike Vittiglio Jan 11 '18 at 15:26

I've decided to make work-around where I just manually go back a few characters and reformat accordingly.

nnoremap <leader>d "=strftime("%Y%m%d%a")<CR>Pxh~
nnoremap <leader>D "=strftime("%Y%m%d%a@%H%M%S")<CR>PF@hxhh~E

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.