Friday, April 24, 2015

Re: Add milliseconds to strftime()

On Friday, April 24, 2015 at 6:02:04 PM UTC+12, av wrote:

> I'd like to know if it is possible to get the milliseconds() in this expression for example:
>
> echo strftime("%Y-%m-%d_%H:%M:%S")

As Paul Isambert says, vim strftime is based on the C function, which uses a struct tm that has no field for parts of a second.

If your vim has python (look for +python in your :version output), you can ask
python, f.ex. in vim

:python import datetime
:python print datetime.datetime.now().strftime("%H:%M:%S.%f")

Regards, John Little

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: