Jun 25, 2019 02:59 AM|Yongqing Yu|LINK
Sorry,I forgot to tell you about it.
Because I don't know what your txtPostingDate.Text stands for, I created a calendar control and set the ID to txtPostingDate.
So here txtPostingDate.SelectedDate.ToString ("yyyy-MM-dd") is a dateTime string the user selected on the calendar.
Ok,I simulated a date-type string and operated in your way:
var PostingDate = DateTime.ParseExact("2019-06-25 10:58:52", "yyyy-MM-dd HH:mm:ss",
Session["PostingDate"] = Convert.ToDateTime(PostingDate.ToString("yyyy-MM-dd")).ToShortDateString();
You could refer to this link: https://stackoverflow.com/questions/919244/converting-a-string-to-datetime