javascript - How to include seconds in the jquery datetimepicker plugin? - Stack Overflow

I am planning to use this's datetimepicker plugin. But in documentation also couldn't find ab

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.

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.

Share Improve this question edited Jun 20, 2020 at 9:12 CommunityBot 11 silver badge asked Oct 1, 2016 at 6:40 Sandeep sandySandeep sandy 3871 gold badge7 silver badges14 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 2

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 mitted 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744215890a4563552.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信