How do you get the current time (not date AND time)?
Example: 5:42:12 PM
DateTime.Now.TimeOfDay gives it to you as a TimeSpan (from midnight).
DateTime.Now.TimeOfDay
TimeSpan
DateTime.Now.ToString("h:mm:ss tt") gives it to you as a string.
DateTime.Now.ToString("h:mm:ss tt")
DateTime reference: https://msdn.microsoft.com/en-us/library/system.datetime
1.4m articles
1.4m replys
5 comments
57.0k users