I got a code snippet for a date and time picker i found in this place: Date and Time Picker
I didn't manage to insert it into my code normally from some reason so i just used the demo code on the bottom and pasted it in my ASP.NET site and this is the code:
// Head
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" media="screen" href="http://tarruda.github.com/bootstrap-datetimepicker/assets/css/bootstrap-datetimepicker.min.css">
// Body
<div id="datetimepicker" class="input-append date">
<input type="text"></input>
<span class="add-on">
<i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
</span>
</div>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js">
</script>
<script type="text/javascript" src="http://tarruda.github.com/bootstrap-datetimepicker/assets/js/bootstrap-datetimepicker.min.js">
</script>
<script type="text/javascript">
$('#datetimepicker').datetimepicker({
format: 'dd/MM/yyyy hh:mm',
pickSeconds: false,
language: 'en'
});
</script>
It works fine and i can see and choose a date and time in my page, but as stated in the API in order to get the time to my Code-Behind i have to use this JavaScript function:
picker.getLocalDate();
The problem is it's a JavaScript function which obviously returns some data, and i have no idea how to get it inside my C# code, I've looked everywhere and found some solutions that didn't work out.
Hope you could tell me what should i do to get it, Thanks!