How do you get the current time of day?

后端 未结 20 2541
长发绾君心
长发绾君心 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:33

    This can be a possible solution:

    DateTime now = DateTime.Now;
    string time = now.ToString("T");
    

提交回复
热议问题