bootstrap datepicker format
时间: 2023-10-06 22:07:06 浏览: 53
Bootstrap Datepicker is a popular datepicker plugin for Bootstrap framework. To set the format of date displayed in the Datepicker, you can use the `format` option.
Here's an example:
```
<input type="text" class="form-control" id="datepicker">
<script>
$(document).ready(function(){
$('#datepicker').datepicker({
format: 'yyyy-mm-dd'
});
});
</script>
```
In this example, the `datepicker` input field will display the selected date in the format of `yyyy-mm-dd`. You can change the format to your desired format.
Some common format options are:
- dd/mm/yyyy
- mm/dd/yyyy
- yyyy-mm-dd
- dd-mm-yyyy
- yyyy/mm/dd
You can find more information about formatting options in the official documentation of Bootstrap Datepicker.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)