Find current time in C#

Home Forums General Programming C# Find current time in C#

This topic contains 0 replies, has 1 voice, and was last updated by  Hirendra Sisodiya 6 years, 6 months ago.

Viewing 1 post (of 1 total)
  • Author
  • #3619

    If you want to get only current time not datetime in C# then you can try the following ways:

    For short time pattern:

    Output: 2:47 PM

    Output: 2:47 PM

    DateTime.Now.ToString(“hh:mm tt”);
    Output: 02:47 PM

    For Long time pattern:

    Output: 2:47:26 PM

    Output: 2:47:37 PM

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.