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:

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

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

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

Answer Source
$("#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.


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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download