Pad time when only 1 digit

This commit is contained in:
SileNce5k 2021-07-04 20:37:10 +02:00
parent 453bf35803
commit f8079bdb14
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -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);
}