How to get Windows Command prompt to display time?

Solution 1:

prompt $t$g

And see http://ss64.com/nt/prompt.html for a complete list

Solution 2:

Attempt 1

Using prompt $t$g (as in the currently accepted answer) results in a prompt as in this example:

14:32:46,28>

Attempt 2

Using prompt $P - $T$H$H$H$G (as in the previously posted answer) results in a prompt like in this example:

C:\Users\Pierre.Vriens - 14:32:46>

Attempt 3

Using prompt $T$H$H$H$H$H$H$G (as mentioned also in a comment from OPer below the currently accepted answer) results in a prompt like in this example:

14:33>

So it looks like this attempt (= nr 3) is the correct answer ... (Credits: Daniel Williams), because:

  • $T results in 14:32:46,28.
  • $H$H$H$H$H$H performs, 6 times, a backspace (i.e. removes the :46,28 part of that).
  • $G adds > to it again.

Solution 3:

prompt $P - $T$H$H$H$G to have it more nicely maybe