js处理时间插件 时间格式:年月日时分秒


本来不是做前端的,但是用到了结果郁闷好久,这里再记录下


引用的时间插件:


<script src="${ctx}/resources/plugin/bootstrap_datatimepicker/js/bootstrap-datetimepicker.min.js">script>
<script src="${ctx}/resources/plugin/bootstrap_datatimepicker/js/bootstrap-datetimepicker.zh-CN.js">script>
<link rel="stylesheet" href="${ctx}/resources/plugin/bootstrap_datatimepicker/css/bootstrap-datetimepicker.min.css" />


指定固定的文本引入时间插件:


$('#shenheDate').datetimepicker({
    language: 'zh-CN',    ---指定的是中文
    format: "yyyy-mm-dd hh:ii:ss",  ----定义的是时间格式
    minuteStep : 1 ---这里是固定的  1 是指定格式每次走1步

});

页面代码:


<input type="text" data-date-format="yyyy-mm-dd" name="shenqingendTiem" id="shenqingendTiem" class="form-control date-picker" value="">

页面显示格式还是自己可以定义,个人觉得时分秒其实没那么必要





你可能感兴趣的:(js处理时间插件 时间格式:年月日时分秒)