merchQrCodeManager/src/utils/utils.ts

15 lines
498 B
TypeScript

export function getFullTime() {
return new Promise((resolve) => {
const today = new Date();
const day = ("0" + today.getDate()).slice(-2);
const month = ("0" + (today.getMonth() + 1)).slice(-2);
const year = today.getFullYear();
const hours = ("0" + today.getHours()).slice(-2);
const minutes = ("0" + today.getMinutes()).slice(-2);
const seconds = ("0" + today.getSeconds()).slice(-2);
resolve(`${day}.${month}.${year} ${hours}:${minutes}:${seconds}`);
});
}