DateTime and TimeSpan completion by using the IntelliSense menu

Applies to: yesVisual Studio noVisual Studio for Mac noVisual Studio Code

This refactoring applies to:

  • C#

What: DateTime and TimeSpan string literal and format string completion through IntelliSense menu.

When: You want to write a DateTime and TimeSpan string literal and format string. IntelliSense gives you basic completion and an explanation as to what each of the characters mean.

Why: Remembering DateTime formats is hard and IntelliSense can help you write it.


  1. Place your cursor in the DateTime or TimeSpan format string.

  2. Press Ctrl+Space to trigger the IntelliSense menu.

  3. Select the character you would like to add.

    DateTime Completion IntelliSense

See also