목차
- <input type="datetime-local"> 예제 - 로컬 년월일시분초 입력
- <input type="datetime-local"> 정의
- <input type="datetime-local"> 구문
<input type="datetime-local"> 예제 - 로컬 년월일시분초 입력
<form action="/action_page.php">
<label for="my_datetime">년월일시분 선택:</label>
<input type="datetime-local" id="my_datetime" name="my_datetime">
<input type="submit">
</form>
결과보기 (전송키값쌍: my_datetime=2023-09-23T22:25)
<input type="datetime-local"> 정의
년월일시분 선택해서 입력 가능한 INPUT 요소. (타임존 고려 X)
1.
- 결과값 형식: 2023-09-23T22:25 (※ T : 날짜와 시간을 구분함.)
- 입력할 땐 오전/오후 택일 방식이나, 서버 전송 땐 24시간제로 전송됨.
- <input type="datetime"> : 존재 X
- <label> 태그 사용 시 웹접근성 향상됨.
2. cf.
- <input type="date"> 태그 - (예) 2023-09-23
- <input type="datetime-local"> 태그 - (예) 2023-09-23T22:25
- <input type="month"> 태그 - 2023-09
- <input type="time"> 태그 - (예) 22:25
- <input type="week"> 태그 - (예) 2023-W38
3.
IE 제외한 주요 최신브라우저 모두 지원.
4. MDN <input type="datetime-local"> 예제보기
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local
<input type="datetime-local"> 구문
<input type="datetime-local">