|
|
@@ -182,8 +182,16 @@ export default class TimeUtil {
|
|
|
*/
|
|
|
|
|
|
public getNowDayStringExtend(data?:number, replace: string = '-'): string {
|
|
|
+ function parse_format(t: number): string {
|
|
|
+ let s: string = t.toString();
|
|
|
+ if (t < 10) {
|
|
|
+ s = "0" + t;
|
|
|
+ }
|
|
|
+ return s;
|
|
|
+ }
|
|
|
+
|
|
|
let date = data?new Date(data):new Date();
|
|
|
- return date.getFullYear() + replace + (date.getMonth()+1) + replace + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
|
|
|
+ return date.getFullYear() + replace + (parse_format(date.getMonth()+1)) + replace + parse_format(date.getDate()) + ' ' + parse_format(date.getHours()) + ':' + parse_format(date.getMinutes()) + ':' + parse_format(date.getSeconds());
|
|
|
}
|
|
|
|
|
|
//等待seconds时间戳
|