HTML

[form] HTML - <input type="datetime-local"> 태그 - 년월일시분 입력 (= 인풋데이트타임로컬타입/데이트타임로컬타입인풋/데이트타임로컬인풋 요소)

목차
  1. <input type="datetime-local"> 예제 - 로컬 년월일시분초 입력
  2. <input type="datetime-local"> 정의
  3. <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">

 



분류 제목
form HTML - <input type="tel"> 태그 - 전화번호 입력 (= 인풋텔타입/텔타입인풋/텔인풋 요소…
form HTML - <input type="text"> 태그 - 1줄 텍스트 입력 (= 인풋텍스트타입/텍스트타입인풋…
form HTML - <input type="time"> 태그 - 시간 입력 (= 인풋타임타입/타임타입인풋/타임인풋 …
form HTML - <input type="url"> 태그 - http(s) 프로토콜 형식의 URL 주소 입력 (=…
form HTML - <input type="week"> 태그 - 연도와 몇주차인지 선택 입력 (= 인풋위크타입/위크…
3/3
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인