개발/JavaScript

javascript | jquery 날짜값 0 입력

AM0530 2020. 3. 18. 14:37
	if(test_date.length < 14) {
		const hourCheck = ('00' + nowDate.getHours()).slice(-2);
		const minuteCheck = ('00' + nowDate.getMinutes()).slice(-2);
		const secondCheck = ('00' + nowDate.getSeconds()).slice(-2);
		test_date = test_date.replaceAll('. ','')+hourCheck+minuteCheck+secondCheck;	
	}
    
    $("#test_date").val(test_date);