Bootstrap Datetimepicker With Example

In this example I give you how to add time picker in your PHP application or HTML etc. this is the full example if you just copy and past below code then you can find time picker. you no need to install anything. I use datetimepicker library for time picker that way you can also set datepicker too. bootstrap datetimepicker is a very popular library. So if you also want to build date and time picker both then also you can set you can see below example.
I set format "HH:mm:ss" but you can also add your custom format like "HH:mm" etc as you want but try this.... and also you set up for 12 hr format by using "HH:mm  A".

For More Details Click Hear
<html lang="en">
<head>
<title>Bootstrap Timepicker Example</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
</head>
<body>
<div class="container" style="margin-top: 20px">
<div style="position: relative">
<input class="form-control" type="text" id="time"/>
</div>
</div>
<script>
$('#time').datetimepicker({
format: 'HH:mm A'
});
</script>
</body>
</html>

Comments

Popular posts from this blog

Laravel 5 Chart example using Charts Package

PHPMyBackup - A PHP MySQL differential backup script

Laravel Stats Tracker