NETCreator Hosting - WebDesign NETCreator Hosting - WebDesign - 5 months ago 329
jQuery Question

Format date with hours, minutes and seconds in jQuery UI Datepicker

Is possible to format date with jQuery UI Datepicker as to show hours, minutes and seconds?

This is the code:

<script>
$(function() {
$('#datepicker').datepicker({ dateFormat: 'yyy-dd-mm HH:MM:ss' }).val();
});
</script>


But if run DatePicker it shows only
201313-07-03 HH:July:ss
.

Example here: http://jsfiddle.net/Qv36W/1/ .

Answer
$("#datepicker").datepicker("option", "dateFormat", "yy-mm-dd ");

For the time picker, you should add timepicker to Datepicker, and it would be formatted with one equivalent command.

EDIT

Use this one that extend jQuery UI Datepicker. You can pick up both date and time.

http://trentrichardson.com/examples/timepicker/

Comments