/**
* 日期转时间戳
* @param {String} time - 日期字符串,如'2018-8-8','2018,8,8','2018/8/8'
* @returns {Number} 返回值为时间毫秒值
*/
function timeToTimestamp (time) {
let date = new Date(time);
let timestamp = date.getTime();
return timestamp;
}
/**
* 日期转时间戳
* @param {String} time - 日期字符串,如'2018-8-8','2018,8,8','2018/8/8'
* @returns {Number} 返回值为时间毫秒值
*/
function timeToTimestamp (time) {
let date = new Date(time);
let timestamp = date.getTime();
return timestamp;
}