อัพเดทเวลา

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-25 17:18:42 +07:00
parent 6c1d146c69
commit 421f4d5805

View file

@ -160,12 +160,30 @@ const confirm = () => {
dialogTime.value = true;
};
var date = Date.now();
let formattedH = moment(date).format("HH");
let formattedM = moment(date).format("mm");
let formattedS = moment(date).format("ss");
// var date = Date.now();
// let formattedH = moment(date).format("HH");
// let formattedM = moment(date).format("mm");
// let formattedS = moment(date).format("ss");
const time = new Date().toLocaleTimeString();
const formattedS = ref();
const formattedM = ref();
const formattedH = ref();
onMounted(() => {
updateClock();
});
//
function updateClock() {
const date = Date.now();
let hh = moment(date).format("HH");
let mm = moment(date).format("mm");
let ss = moment(date).format("ss");
formattedS.value = ss;
formattedM.value = mm;
formattedH.value = hh;
}
setInterval(updateClock, 1000); // 1
</script>
<style></style>