How about:
dateTime.ToString("tt", CultureInfo.InvariantCulture);
More Related Contents:
- .NET: Why is TryParseExact failing on Hmm and Hmmss?
- DateTime vs DateTimeOffset
- Given a DateTime object, how do I get an ISO 8601 date in string format?
- Parse DateTime with time zone of form PST/CEST/UTC/etc
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- Is DateTime.Now the best way to measure a function’s performance? [closed]
- Algorithm to detect overlapping periods [duplicate]
- How to create a .NET DateTime from ISO 8601 format
- C# DateTime.Now precision
- How to get difference between two dates in Year/Month/Week/Day?
- How to know if a DateTime is between a DateRange in C#
- How do I get the last day of a month?
- What does “DateTime?” mean in C#?
- Measuring code execution time
- Get Month name from month number
- How do I represent a time only value in .NET?
- Parse C# string to DateTime
- DateTime ToString issue with formatting months with “mm” specifier
- Getting Date or Time only from a DateTime Object
- How can I format DateTime to web UTC format?
- Convert String to Date in .NET if my incoming date format is in YYYYMMDD
- How to parse and generate DateTime objects in ISO 8601 format
- DateTime conversion from string C#
- Convert DateTime to a specified Format
- DateTime.Parse(“2012-09-30T23:00:00.0000000Z”) always converts to DateTimeKind.Local
- Getting the first and last day of a month, using a given DateTime object
- Convert Date from Persian to Gregorian
- Unix time conversions in C# [duplicate]
- LINQ Query to Convert string to datetime
- .NET DateTime to SqlDateTime Conversion