How do you get the current time of day?

后端 未结 20 2519
长发绾君心
长发绾君心 2020-11-28 18:40

How do you get the current time (not date AND time)?

Example: 5:42:12 PM

相关标签:
20条回答
  • 2020-11-28 19:43
    DateTime.Now.ToString("yyyy-MM-dd h:mm:ss tt");
    

    just Try It's use full to your Need

    0 讨论(0)
  • 2020-11-28 19:43

    Get the current date and time, then just use the time portion of it. Look at the possibilities for formatting a date time string in the MSDN docs.

    0 讨论(0)
提交回复
热议问题