Hi Frnds,
any one knows how to convert date time from (27/10/2011) to (2010/10/27)
i need to insert in to database table(sql format (yyyy/mm/dd).
please any one knows well in this scenario help me
Thaks
Venkat.S
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Prabhu RajaPosted Oct 28, 2011, 12:20 AM
Also try this one.
if ( DateTime.TryParse( dt.ToString("yyyy/mm/dd"), out dateString)
{
//dateString variable will have date in Specified Format.
}
else
{
//The Date is not Converted to Specified format.
}
Suthish NairPosted Oct 27, 2011, 2:33 PM
Hemant KumarPosted Oct 27, 2011, 5:13 AM
Please refer this article for more information on Date Time
http://www.c-sharpcorner.com/UploadFile/vemuhemanth/9435/
VulpesPosted Oct 27, 2011, 4:17 AM
DateTime dt = new DateTime(2011, 10, 27);
string dateStr = dt.ToString("yyyy/MM/dd");