JustMeToo
JustMeToo

Reputation: 425

how to create code snippet that includes date

I am getting tired of adding the date when I add a comment about some change I am making in the code. I am required to start comments like this:

// 14/03/24 fj: some comment

I don't need to repeat it on continued lines, just the first.

I am trying to create a code snippet to do this, but can't figure out how to reference the date inside my CDATA block. I tried searching, but couldn't find anything. Any ideas/links/etc.?

Thanks!

Upvotes: 0

Views: 257

Answers (1)

DLeh
DLeh

Reputation: 24395

I'd recommend creating an AutoHotkey script for yourself, as code snippets have very limited logic available to them. Using AutoHotkey has the added bonus of working everywhere, and not being language specific.

Here's the AutoHotkey script you could use:

::\stamp::
FormatTime, TimeString,, ShortDate
Send %TimeString% fj
return

Typing \stamp will replace \stamp with 3/24/2015 fj

Upvotes: 2

Related Questions