Reputation: 21
Is there any way I can get milliseconds in bootstrap . I am using DB2 time stamp for inserting the date time. So while performing the search I need to allow the user to select date and time with milliseconds also. I tried using the link (http://trentrichardson.com/examples/timepicker/) but I was not able to get the slider. Can anyone help me with how to order the required js and css files. Or is there anyway I can get datetimepicker with the format e.g 2016-12-11 02:22:22.444444(6 digits). This is the order I have included files.
<script src="/lib/jquery-1.12.4.min.js"></script>
<script src="/lib/jquery-ui-1.12.1.custom/jquery-ui.min.js"</script>
<script src="/lib/jquery-ui-sliderAccess.js"></script>
<script src="/lib/jquery-timepicker-1.3.5/jquery.timepicker.min.js">/script>
<script src="/lib/jquery-ui-timepicker-addon.js"></script>
<script src="/lib/jquery.dataTables.min.js"></script>
<script src="/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script src="/lib/angular-1.5.8/angular.min.js"></script>
<script src="/lib/angular-datatables.min.js"></script>
<script src="/lib/angular-1.5.8/angular-route.min.js"></script>
<script src="/lib/bootstrap-datepicker-master/bootstrap-datepicker-master/dist/js/bootstrap-datepicker.min.js"></script>
<script src="/jsfiles/scriptfile1.js"></script>
<link rel="stylesheet" type="text/css" href="/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/lib/jquery-ui-1.12.1.custom/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="/lib/jquery-timepicker-1.3.5/jquery.timepicker.min.css">
<link rel="stylesheet" type="text/css" href="/lib/jquery-ui-timepicker-addon.css">
<link rel="stylesheet" href="/lib/datatables.bootstrap.min.css">
<link rel="stylesheet" href="/lib/angular-datatables.min.css">
<link rel="stylesheet" href="/lib/bootstrap-datepicker-master/bootstrap-datepicker-master/dist/css/bootstrap-datepicker3.css">
<link rel="stylesheet" type="text/css" href="/lib/font-awesome-4.6.3/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="/controllers/controller.js"></script>
Upvotes: 1
Views: 9192
Reputation: 4989
You can try this
Check working demo HERE
JS:
$('#basic_example_3').datetimepicker({
timeFormat: "hh:mm:ss:l tt"
});
It will give you this
As per your requirement you need 6 digit for millisecond. But in background the JavaScript getMilliseconds()
Method returns the milliseconds (from 0 to 999) of the specified date and time.
Even though if you force to set getMilliseconds()
to 6 digit, it will be of no use as it returns 000999
because 1000 millisecond = 1 second.
You can try yourself by setting the milli second digit example here
Upvotes: 0