简体   繁体   中英

How to include seconds in the jquery datetimepicker plugin?

I am planning to use this 's datetimepicker plugin. But in documentation also couldn't find about seconds part. Can you guys help me how to provide seconds in this plugin. Seconds is the mandatory thing for the requirement or suggest any good MIT open license plugin which has seconds also for date and time.

add following JQuery code...

$('#yourexample').datetimepicker({
   showSecond: true,
   showMillisec: true,
   timeFormat: 'hh:mm:ss:l'
});
<input id="calendar">

$('#calendar').datetimepicker({
        format:'d/m/Y H:i:s'
});

By adding format as an option in datetimepicker as above it is taking the seconds. Seconds are not showing in datetimepicker ui but taking current seconds and displaying in the input box then we can edit as per our requirement. If any one find a way to show seconds in the ui also that could be appreciable.

This is my first answer please let me correct if I committed any mistake.

Thank you.

By adding

 $('#reservationtime').daterangepicker({ timePicker: true, timePickerSeconds: true, timePickerIncrement: 30, locale: { format: 'MM/DD/YYYY hh:mm:ss' } })

It worked for displaying seconds in datetimePicker UI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM