Date 객체
시간 꺼내기
let hours = ('0'+today.getHours()).slice(-2);
분꺼내기
let minutes = ('0'+ today.getMinutes()).slice(-2);//분
초꺼내기
let seconds = ('0'+today.getSeconds()).slice(-2);//초
시간+분+초 합치기
let timeString = hours + ":" + minutes + ":" + seconds;
원본
<script type="text/javascript">
function fnCt(){
let today = new Date();
let hours = ('0'+today.getHours()).slice(-2);
let minutes = ('0'+ today.getMinutes()).slice(-2);//분
let seconds = ('0'+today.getSeconds()).slice(-2);//초
let timeString = hours + ":" + minutes + ":" + seconds;
console.log("timeString"+timeString);