How do I insert the current date/time stamp into the file?

You can use the strftime() function to insert the current data/time stamp in a file. For example, you can use the following abbreviation:

    iabbrev dts =strftime("%y/%m/%d %H:%M")

With this abbreviation, when you type dts in insert mode, it will be expanded to the date/time stamp. Some other forms of the above abbreviation are listed below:

    iabbrev mdyl =strftime("%a %d %b %Y")

    iabbrev mdys =strftime("%y%m%d")

    iabbrev mdyc =strftime("%c")

    iabbrev hml  =strftime("%d/%m/%y %H:%M:%S")

    iabbrev hms  =strftime("%H:%M:%S")

Read free Software Algorithms and Computer Science Books by CodeAhoy Learn.

Introduction to Recursion and Backtracking

Sorting Algorithms

Introduction to C Programming Language

And More...

Speak Your Mind