Examples:
string data = "08072013";
string hora = "1515";
Is there a specific method for this type of format? I tried to use Convert.ToDateTime()
, DateTime.Parse
, etc. and everyone returned an exception. I'm currently doing the following:
StringBuilder strBuilder = new StringBuilder();
strBuilder.Append(data).Insert(2, "/").Insert(5, "/");
strBuilder.Append(" " + hora).Insert(13, ":");
DateTime dateTime = new DateTime();
dateTime = Convert.ToDateTime(strBuilder.ToString());