Pad time when only 1 digit
This commit is contained in:
parent
453bf35803
commit
f8079bdb14
1 changed files with 5 additions and 2 deletions
|
@ -1,3 +1,6 @@
|
|||
module.exports = function (date){
|
||||
return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds();
|
||||
}
|
||||
|
||||
|
||||
|
||||
return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+('0' + date.getUTCHours()).slice(-2)+":"+('0' + date.getUTCMinutes()).slice(-2)+":"+('0'+date.getUTCSeconds()).slice(-2);
|
||||
}
|
Loading…
Add table
Reference in a new issue