I am getting date from DB2 in CYYMMDD format 1234567,i have to convert this into normal asp.net date using C#.
how to convert CYYMMDD date format to asp.net dateformat YYYY-MM-DD in asp.net using
Collapse
X
-
Tags: None
-
Hi Thanks for the reply. But Here you are using DateTime.Now.so it is working fine but my case i am getting the value from DB2 in the format CYYMMDD.Originally posted by Elisa GraceddTry this.....
The ToString method on the DateTime struct can take a format parameter:
var dateAsString = DateTime.Now.To String("yyyy-MM-dd");
// dateAsString = "2015-12-17"
Read also
ASP.NET Tutorials
i.e for example 0170312 then first i have to convert this string value to Date.
this string contains 7 digits and converting itself failed.
Comment