我想将josn日期对象转换为angularjs中的毫秒数,例如:
2018-01-13T12:22:06.165Z至237891242128
任何帮助都会被appriciated.thnaks
答案 0 :(得分:0)
您可以使用var date = new Date("2018-01-13T12:22:06.165Z");
console.log(date.getTime());
<input style="width:200px; padding:10px; border-radius:4px;"type="text" placeholder="search name" ng-model='productFilter'>
<input type="date" ng-model="to_date">
<input type="date" ng-model="from_date">
<div ng-repeat="product in products | dateRange : from_date : to_date | filter: productFilter track by $index">
<p>Total Inputs: {{product.createdAt}}{{product._id}}</p>
</div>
答案 1 :(得分:0)
如果你有一个Javascript日期,你可以使用:
var timestampDate = new Date().getTime();