11< html >
2-
3- < head >
4- < link rel ="stylesheet " type ="text/css " href ="datetime.css ">
2+ < head >
3+ < link rel ="stylesheet " type ="text/css " href ="datetime.css " />
54 < title > Get date and time in all supported formats in Java</ title >
65 < h1 > Enter date and time values</ h1 >
7- </ head >
8-
9- < body >
10- < form method ="post " action ="datetime.jsp ">
11- < label for ="year "> Year:</ label > < br >
12- < input type ="number " name ="year " id ="year " required onchange ="getDaysInMonth() "> < br >
13- < label for ="month "> Month:</ label > < br >
14- < input type ="number " name ="month " id ="month " min ="1 " max ="12 " required onchange ="getDaysInMonth() "> < br >
15- < label for ="day "> Day:</ label > < br >
16- < input type ="number " name ="day " id ="day " min ="1 " max ="31 " required > < br >
17- < label for ="hour "> Hour:</ label > < br >
18- < input type ="number " name ="hour " id ="hour " min ="0 " max ="23 " required > < br >
19- < label for ="minute "> Minute:</ label > < br >
20- < input type ="number " name ="minute " id ="minute " min ="0 " max ="59 " required > < br >
21- < label for ="second "> Second:</ label > < br >
22- < input type ="number " name ="second " id ="second " min ="0 " max ="59 " required > < br >
23- < label for ="millisecond "> Millisecond:</ label > < br >
24- < input type ="number " name ="millisecond " id ="millisecond " min ="0 " max ="999 " required value ="0 "> < br >
25- < label for ="microsecond "> Microsecond:</ label > < br >
26- < input type ="number " name ="microsecond " id ="microsecond " min ="0 " max ="999 " required value ="0 "> < br >
27- < label for ="nanosecond "> Nanosecond:</ label > < br >
28- < input type ="number " name ="nanosecond " id ="nanosecond " min ="0 " max ="999 " required value ="0 "> < br >
29- < button type ="button " onclick ="setCurrentDate() "> Set Current Local Date and Time</ button >
30- < button type ="button " onclick ="setCurrentUtcDate() "> Set Current UTC Date and Time</ button >
31- < input type ="submit " value ="Submit ">
32- </ form >
33- < script src ="datetime.js "> </ script >
34- </ body >
6+ </ head >
357
36- </ html >
8+ < body >
9+ < form method ="post " action ="datetime.jsp ">
10+ < label for ="year "> Year:</ label > < br />
11+ < input
12+ type ="number "
13+ name ="year "
14+ id ="year "
15+ required
16+ onchange ="getDaysInMonth() "
17+ /> < br />
18+ < label for ="month "> Month:</ label > < br />
19+ < input
20+ type ="number "
21+ name ="month "
22+ id ="month "
23+ min ="1 "
24+ max ="12 "
25+ required
26+ onchange ="getDaysInMonth() "
27+ /> < br />
28+ < label for ="day "> Day:</ label > < br />
29+ < input
30+ type ="number "
31+ name ="day "
32+ id ="day "
33+ min ="1 "
34+ max ="31 "
35+ required
36+ /> < br />
37+ < label for ="hour "> Hour:</ label > < br />
38+ < input
39+ type ="number "
40+ name ="hour "
41+ id ="hour "
42+ min ="0 "
43+ max ="23 "
44+ required
45+ /> < br />
46+ < label for ="minute "> Minute:</ label > < br />
47+ < input
48+ type ="number "
49+ name ="minute "
50+ id ="minute "
51+ min ="0 "
52+ max ="59 "
53+ required
54+ /> < br />
55+ < label for ="second "> Second:</ label > < br />
56+ < input
57+ type ="number "
58+ name ="second "
59+ id ="second "
60+ min ="0 "
61+ max ="59 "
62+ required
63+ /> < br />
64+ < label for ="millisecond "> Millisecond:</ label > < br />
65+ < input
66+ type ="number "
67+ name ="millisecond "
68+ id ="millisecond "
69+ min ="0 "
70+ max ="999 "
71+ required
72+ value ="0 "
73+ /> < br />
74+ < label for ="microsecond "> Microsecond:</ label > < br />
75+ < input
76+ type ="number "
77+ name ="microsecond "
78+ id ="microsecond "
79+ min ="0 "
80+ max ="999 "
81+ required
82+ value ="0 "
83+ /> < br />
84+ < label for ="nanosecond "> Nanosecond:</ label > < br />
85+ < input
86+ type ="number "
87+ name ="nanosecond "
88+ id ="nanosecond "
89+ min ="0 "
90+ max ="999 "
91+ required
92+ value ="0 "
93+ /> < br />
94+ < button type ="button " onclick ="setCurrentDate() ">
95+ Set Current Local Date and Time
96+ </ button >
97+ < button type ="button " onclick ="setCurrentUtcDate() ">
98+ Set Current UTC Date and Time
99+ </ button >
100+ < input type ="submit " value ="Submit " />
101+ </ form >
102+ < script src ="datetime.js "> </ script >
103+ </ body >
104+ </ html >
0 commit comments