Hey akhter,
Please refer below sample.
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
string str = "201812140444";
DateTime date = Convert.ToDateTime(str.Insert(4, "-").Insert(7, "-").Insert(10, " ").Insert(13, ":"));
Response.Write(date.ToString("dd-MM-yyyy hh:mm:tt"));
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim str As String = "201812140444"
Dim datee As DateTime = Convert.ToDateTime(str.Insert(4, "-").Insert(7, "-").Insert(10, " ").Insert(13, ":"))
Response.Write(datee.ToString("dd-MM-yyyy hh:mm:tt"))
End Sub
Output
14-12-2018 04:44:AM