المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Need date formate like yyyy-MM-dd with time like "2008-07-08 20:24:14" in Excel



C# Programming
06-24-2009, 10:24 PM
Hi all,

As per my requirement, while displaying date (i.e audit column) in datagrid is coming fine but same column while displaying in excel formate it is displaying as "2008-07-08" unable to get this (2008-07-08 20:24:14) formate i am using the following code

sbrHTML.Append(";.premium { mso-number-format:$\\#\\,\\#\\#0\\.00;} .ogDate {mso-ignore:padding;mso-generic-font-family:auto;mso-font-charsethttp://www.barakasoft.com/script/Forums/Images/smiley_redface.gif;mso-number-format:yyyy-MM-dd;mso-background-source:auto;mso-pattern:auto;} ;");

then i am applying style for audit like the following

sbrHTML.Append(";" + (sqlDatareader.IsDBNull(columnIndex) ? "" : sqlDatareader["AUDIT_DATE"].ToString() + ";")); ogDate

For the above stmt i am able to get only this formate "2008-07-08" but i need to include time also.

Could any one help me in mso-number-formate: to get date formate like "2008-07-08 20:24:14"

thanks,
eswar.