DateTime.Now.TimeOfDay
gives it to you as a TimeSpan
(from midnight).
DateTime.Now.ToString("h:mm:ss tt")
gives it to you as a string.
DateTime reference: https://msdn.microsoft.com/en-us/library/system.datetime
More Related Contents:
- How do I get the correct time in C#
- how to increase time by 15 mins using c#
- Calculate relative time in C#
- C# DateTime to “YYYYMMDDHHMMSS” format
- Creating a DateTime in a specific Time Zone in c#
- Calculate the number of business days between two dates?
- Convert string to DateTime in c#
- How can I get the DateTime for the start of the week?
- How do I format a DateTime in a different format?
- calculating the difference in months between two dates
- How to get only time from date-time C# [closed]
- How to get client date and time in ASP.NET?
- Format a date in XML via XSLT
- How to compare DateTime in C#?
- How to Validate a DateTime in C#?
- How to convert DateTime to/from specific string format (both ways, e.g. given Format is “yyyyMMdd”)?
- How to change time in DateTime?
- Convert DateTime for MySQL using C#
- How does DateTime.ToUniversalTime() work?
- Convert DateTime to Julian Date in C# (ToOADate Safe?)
- Is there any difference between DateTime in c# and DateTime in SQL server?
- Difference between System.DateTime.Now and System.DateTime.Today
- Where’s the DateTime ‘Z’ format specifier?
- Getting time span between two times in C#?
- C# date formatting is losing slash separators
- Set Default DateTime Format c#
- Convert Date from Persian to Gregorian
- Unix time conversions in C# [duplicate]
- Add hours or minutes to the current time
- Datetime format Issue: String was not recognized as a valid DateTime