c# - Remove seconds from local time but keep format -


assume have utc time string converted local time:

utctimestring.tolocaltime().tostring(); => "01/31/2012 12:00:00 pm" 

how remove seconds result string keep format (set in phone settings?)

thanks!

utctimestring.tolocaltime().tostring("mm/dd/yyyy hh:mm tt"); 

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx

as alternative, 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


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -