In the previous article, we talked about angular's encapsulated plugin for timepicker.But because the angular version must be v1.2.30 or higher. For some large systems,Upgrading the angular version for a while is really time consuming.Then you can use this method to get the value.

The time format on the page looks like this:

File introduction

"/bootstrap-datetimepicker.min.css","/bootstrap-datetimepicker.min.js","/bootstrap-datetimepicker.zh-cn.js",//Chinese package


<div data-date-format="yyyy-mm-dd hh:ii:ss" data-link-field="dtp_input1">//Set the time format to yyyy-mm-dd hh:ii:ss. Set id to effstartdate
<input size="16" type="text" value="" readonly>


var datefrom=$("#effstartdate input"). val ();//Set an id to the value of bootstrap timepicker
 $scope.effstartdate=new date (datefrom.substring (0,19) .replace (/-/g, "/")). gettime ()/1000;//Convert to timestamp


  • Previous Detailed explanation of if and else based on shell
  • Next C ++ stack (template) template class implementation code
  • Trends