|
@@ -12,10 +12,10 @@ export function toTimestamp(str) {
|
|
* 将时间戳转化成 类似的时间 ‘20190910081000’
|
|
* 将时间戳转化成 类似的时间 ‘20190910081000’
|
|
* @param {Number} timestamp 时间戳
|
|
* @param {Number} timestamp 时间戳
|
|
*/
|
|
*/
|
|
-export function timestamp2String(timestamp) {
|
|
|
|
|
|
+export function timestamp2String(timestamp, wasAddOne = false) {
|
|
const date = new Date(timestamp)
|
|
const date = new Date(timestamp)
|
|
const year = date.getFullYear()
|
|
const year = date.getFullYear()
|
|
- const month = add0(date.getMonth() + 1)
|
|
|
|
|
|
+ const month = add0(wasAddOne ? date.getMonth() : date.getMonth() + 1)
|
|
const day = add0(date.getDate())
|
|
const day = add0(date.getDate())
|
|
const hours = add0(date.getHours())
|
|
const hours = add0(date.getHours())
|
|
const minutes = add0(date.getMinutes())
|
|
const minutes = add0(date.getMinutes())
|