String was not recognized as a valid DateTime.
Javascript
<script type="text/javascript">
$(document).ready(function () {
$(function () {
alert("time");
var d = new Date().getDate();
var m = new Date().getMonth() + 1; // JavaScript months are 0-11
var y = new Date().getFullYear();
// $("[id$=txtdate]").val(d + "/" + m + "/" + y);
$("[id$=txtdate]").val(y + "/" + m + "/" + d);
$("[id$=txtdate]").datepicker({ weekStart: 1, dateFormat: 'yyyy/mm/dd' });
});
});
</script>
Design Page
<asp:TextBox ID="txtdate" runat="server" type='text' value="{{date | date:'yyyy-MM-dd'}}" placeholder="DateTime" class="form-control col-sm 3"></asp:TextBox>
C# Coding
objSchema.TimeStamp = DateTime.ParseExact(txtdate.Text, "yyyy/dd/MM", null);