[dba-VB] FYI: TimeStamp formatting issue for VS2010/.NET 4.0

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Sun Jun 5 15:12:43 CDT 2011


Hi All --

FYI: I have got used to format TimeStamp values this simple way (for
TimeStamp values less than a day):

TimeStamp ts = new TimeStamp(10,11,12);
string s = string.Format("{0:hh:mm:ss}", ts);
System.Console.WriteLine(s);

and it worked well for VS2008/.NET 3.5 but when my project was converted to
VS2010SP1/.NET 4.0 I have got runtime error...

Proper TimeStamp formatting for my case should be {0:hh\\:mm\\:ss} :

TimeStamp ts = new TimeStamp(10,11,12);
string s = string.Format("{0:hh\\:mm\\:ss}", ts);
System.Console.WriteLine(s);

Source: http://msdn.microsoft.com/en-us/library/ee372287.aspx

Thank you.

--
Shamil
 




More information about the dba-VB mailing list