Remove seconds from local time but keep format
c#, silverlight, windows-phone-7
Solution
utcTimeString.ToLocalTime().ToString("MM/dd/yyyy hh:mm tt");
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
As an alternative, you can use
String.Format("{0:d} {0:t}",utcTimeString.ToLocalTime());
String.Format("{0:g}",utcTimeString.ToLocalTime());
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx
Problem
Assume you have UTC time string converted to local time: ``` utcTimeString.ToLocalTime().ToString(); => "01/31/2012 12:00:00 PM" ``` How to remove seconds from result string but keep format (set in phone settings?) Thanks!