I'm trying to display the date from the code behind in the bootstrap DateTimePicker
, but it won't display correctly.
This is my HTML/ASP Script:
<asp:TableCell>
<asp:Label ID="Label9" runat="server" Text="Label">DATE ISSUED:</asp:Label>
<div class="form-group">
<div class='input-group date' id='datetimepicker1'>
<asp:TextBox ID="txt_DateIssued" runat="server"
CssClass="form-control" Width="374px">
</asp:TextBox>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</asp:TableCell>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({ format: 'YYYY-MM-DD' });
});
</script>
And here's my C# code:
txt_DateIssued.Text = "2016-03-13";
Output: Output - DateTimePicker
and when I clicked on the calendar icon, the year begins at 0003 :(
QUESTION:
How can I display the date 2016-03-13
on the textbox?