DateTime

There are no DateTime functions available for snippets but here is a macro that will insert the current DateTime:

Sub PrintDateTime()
    If (Not IsNothing(DTE.ActiveDocument)) Then
        Dim selection As TextSelection = DTE.ActiveDocument.Selection
        selection.Insert(DateTime.Now.ToString())
    End If
End Sub

You can open your macro explorer with Alt + F8 and create a new module and paste the code above inside the module that is generated.

Then create a new keyboard shortcut and bind it to your macro.

原文地址:https://www.cnblogs.com/gossip/p/2105551.html