CampFirePlay/utils/getCurrentTime.js
Degradin baa0b5f3a9 global refactoring
Все переведено в модули
2023-10-08 23:43:12 +03:00

10 lines
604 B
JavaScript

module.exports = () => {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() < 9 ? `0${now.getMonth() + 1}` : now.getMonth() + 1;
const day = now.getDate() < 10 ? `0${now.getDate()}` : now.getDate();
const hours = now.getHours() < 10 ? `0${now.getHours()}` : now.getHours();
const minutes = now.getMinutes() < 10 ? `0${now.getMinutes()}` : now.getMinutes();
const seconds = now.getSeconds() < 10 ? `0${now.getSeconds()}` : now.getSeconds();
return `${day}.${month}.${year} ${hours}:${minutes}:${seconds}`;
}