Sometimes you have to pull a date from Oracle in a cleaner format, this is one way to achieve the format you want.
// Convert the Oracle date 19000101 to 01-01-1900 public string OracleCleanDate(string strDate) { if (strDate.Length == 8) { string strYear, strMonth, strDay; strYear = strDate.Substring(0, 4); strMonth = strDate.Substring(4, 2); strDay = strDate.Substring(6, 2); strDate = strMonth + "-" + strDay + "-" + strYear; } return strDate; }
Last Updated on October 26, 2015