출처 : http://wiki.gimslab.com/moniwiki/wiki.php/Calendar
1 java.util.Calendar Constant Field test
==================================================================== YEAR=2011 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Dec(11) 1 Thu(5) 1 335 1 1 49 Dec(11) 2 Fri(6) 2 336 1 1 49 Dec(11) 3 Sat(7) 3 337 1 1 49 Dec(11) 4 Sun(1) 4 338 1 2 50 Dec(11) 5 Mon(2) 5 339 1 2 50 Dec(11) 6 Tue(3) 6 340 1 2 50 Dec(11) 7 Wed(4) 7 341 1 2 50 Dec(11) 8 Thu(5) 8 342 2 2 50 Dec(11) 9 Fri(6) 9 343 2 2 50 Dec(11) 10 Sat(7) 10 344 2 2 50 Dec(11) 11 Sun(1) 11 345 2 3 51 Dec(11) 12 Mon(2) 12 346 2 3 51 Dec(11) 13 Tue(3) 13 347 2 3 51 Dec(11) 14 Wed(4) 14 348 2 3 51 Dec(11) 15 Thu(5) 15 349 3 3 51 Dec(11) 16 Fri(6) 16 350 3 3 51 Dec(11) 17 Sat(7) 17 351 3 3 51 Dec(11) 18 Sun(1) 18 352 3 4 52 Dec(11) 19 Mon(2) 19 353 3 4 52 Dec(11) 20 Tue(3) 20 354 3 4 52 Dec(11) 21 Wed(4) 21 355 3 4 52 Dec(11) 22 Thu(5) 22 356 4 4 52 Dec(11) 23 Fri(6) 23 357 4 4 52 Dec(11) 24 Sat(7) 24 358 4 4 52 Dec(11) 25 Sun(1) 25 359 4 5 53 Dec(11) 26 Mon(2) 26 360 4 5 53 Dec(11) 27 Tue(3) 27 361 4 5 53 Dec(11) 28 Wed(4) 28 362 4 5 53 Dec(11) 29 Thu(5) 29 363 5 5 53 Dec(11) 30 Fri(6) 30 364 5 5 53 Dec(11) 31 Sat(7) 31 365 5 5 53 ==================================================================== YEAR=2012 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Jan(0) 1 Sun(1) 1 1 1 1 1 Jan(0) 2 Mon(2) 2 2 1 1 1 Jan(0) 3 Tue(3) 3 3 1 1 1 Jan(0) 4 Wed(4) 4 4 1 1 1 Jan(0) 5 Thu(5) 5 5 1 1 1 Jan(0) 6 Fri(6) 6 6 1 1 1 Jan(0) 7 Sat(7) 7 7 1 1 1 Jan(0) 8 Sun(1) 8 8 2 2 2 Jan(0) 9 Mon(2) 9 9 2 2 2 Jan(0) 10 Tue(3) 10 10 2 2 2 Jan(0) 11 Wed(4) 11 11 2 2 2 Jan(0) 12 Thu(5) 12 12 2 2 2 Jan(0) 13 Fri(6) 13 13 2 2 2 Jan(0) 14 Sat(7) 14 14 2 2 2 Jan(0) 15 Sun(1) 15 15 3 3 3 Jan(0) 16 Mon(2) 16 16 3 3 3 Jan(0) 17 Tue(3) 17 17 3 3 3 Jan(0) 18 Wed(4) 18 18 3 3 3 Jan(0) 19 Thu(5) 19 19 3 3 3 Jan(0) 20 Fri(6) 20 20 3 3 3 Jan(0) 21 Sat(7) 21 21 3 3 3 Jan(0) 22 Sun(1) 22 22 4 4 4 Jan(0) 23 Mon(2) 23 23 4 4 4 Jan(0) 24 Tue(3) 24 24 4 4 4 Jan(0) 25 Wed(4) 25 25 4 4 4 Jan(0) 26 Thu(5) 26 26 4 4 4 Jan(0) 27 Fri(6) 27 27 4 4 4 Jan(0) 28 Sat(7) 28 28 4 4 4 Jan(0) 29 Sun(1) 29 29 5 5 5 Jan(0) 30 Mon(2) 30 30 5 5 5 Jan(0) 31 Tue(3) 31 31 5 5 5 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Feb(1) 1 Wed(4) 1 32 1 1 5 Feb(1) 2 Thu(5) 2 33 1 1 5 Feb(1) 3 Fri(6) 3 34 1 1 5 Feb(1) 4 Sat(7) 4 35 1 1 5 Feb(1) 5 Sun(1) 5 36 1 2 6 Feb(1) 6 Mon(2) 6 37 1 2 6 Feb(1) 7 Tue(3) 7 38 1 2 6 Feb(1) 8 Wed(4) 8 39 2 2 6 Feb(1) 9 Thu(5) 9 40 2 2 6 Feb(1) 10 Fri(6) 10 41 2 2 6 Feb(1) 11 Sat(7) 11 42 2 2 6 Feb(1) 12 Sun(1) 12 43 2 3 7 Feb(1) 13 Mon(2) 13 44 2 3 7 Feb(1) 14 Tue(3) 14 45 2 3 7 Feb(1) 15 Wed(4) 15 46 3 3 7 Feb(1) 16 Thu(5) 16 47 3 3 7 Feb(1) 17 Fri(6) 17 48 3 3 7 Feb(1) 18 Sat(7) 18 49 3 3 7 Feb(1) 19 Sun(1) 19 50 3 4 8 Feb(1) 20 Mon(2) 20 51 3 4 8 Feb(1) 21 Tue(3) 21 52 3 4 8 Feb(1) 22 Wed(4) 22 53 4 4 8 Feb(1) 23 Thu(5) 23 54 4 4 8 Feb(1) 24 Fri(6) 24 55 4 4 8 Feb(1) 25 Sat(7) 25 56 4 4 8 Feb(1) 26 Sun(1) 26 57 4 5 9 Feb(1) 27 Mon(2) 27 58 4 5 9 Feb(1) 28 Tue(3) 28 59 4 5 9 Feb(1) 29 Wed(4) 29 60 5 5 9 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Mar(2) 1 Thu(5) 1 61 1 1 9 Mar(2) 2 Fri(6) 2 62 1 1 9 Mar(2) 3 Sat(7) 3 63 1 1 9 Mar(2) 4 Sun(1) 4 64 1 2 10 Mar(2) 5 Mon(2) 5 65 1 2 10 Mar(2) 6 Tue(3) 6 66 1 2 10 Mar(2) 7 Wed(4) 7 67 1 2 10 Mar(2) 8 Thu(5) 8 68 2 2 10 Mar(2) 9 Fri(6) 9 69 2 2 10 Mar(2) 10 Sat(7) 10 70 2 2 10 Mar(2) 11 Sun(1) 11 71 2 3 11 Mar(2) 12 Mon(2) 12 72 2 3 11 Mar(2) 13 Tue(3) 13 73 2 3 11 Mar(2) 14 Wed(4) 14 74 2 3 11 Mar(2) 15 Thu(5) 15 75 3 3 11 Mar(2) 16 Fri(6) 16 76 3 3 11 Mar(2) 17 Sat(7) 17 77 3 3 11 Mar(2) 18 Sun(1) 18 78 3 4 12 Mar(2) 19 Mon(2) 19 79 3 4 12 Mar(2) 20 Tue(3) 20 80 3 4 12 Mar(2) 21 Wed(4) 21 81 3 4 12 Mar(2) 22 Thu(5) 22 82 4 4 12 Mar(2) 23 Fri(6) 23 83 4 4 12 Mar(2) 24 Sat(7) 24 84 4 4 12 Mar(2) 25 Sun(1) 25 85 4 5 13 Mar(2) 26 Mon(2) 26 86 4 5 13 Mar(2) 27 Tue(3) 27 87 4 5 13 Mar(2) 28 Wed(4) 28 88 4 5 13 Mar(2) 29 Thu(5) 29 89 5 5 13 Mar(2) 30 Fri(6) 30 90 5 5 13 Mar(2) 31 Sat(7) 31 91 5 5 13 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Apr(3) 1 Sun(1) 1 92 1 1 14 Apr(3) 2 Mon(2) 2 93 1 1 14 Apr(3) 3 Tue(3) 3 94 1 1 14 Apr(3) 4 Wed(4) 4 95 1 1 14 Apr(3) 5 Thu(5) 5 96 1 1 14 Apr(3) 6 Fri(6) 6 97 1 1 14 Apr(3) 7 Sat(7) 7 98 1 1 14 Apr(3) 8 Sun(1) 8 99 2 2 15 Apr(3) 9 Mon(2) 9 100 2 2 15 Apr(3) 10 Tue(3) 10 101 2 2 15 Apr(3) 11 Wed(4) 11 102 2 2 15 Apr(3) 12 Thu(5) 12 103 2 2 15 Apr(3) 13 Fri(6) 13 104 2 2 15 Apr(3) 14 Sat(7) 14 105 2 2 15 Apr(3) 15 Sun(1) 15 106 3 3 16 Apr(3) 16 Mon(2) 16 107 3 3 16 Apr(3) 17 Tue(3) 17 108 3 3 16 Apr(3) 18 Wed(4) 18 109 3 3 16 Apr(3) 19 Thu(5) 19 110 3 3 16 Apr(3) 20 Fri(6) 20 111 3 3 16 Apr(3) 21 Sat(7) 21 112 3 3 16 Apr(3) 22 Sun(1) 22 113 4 4 17 Apr(3) 23 Mon(2) 23 114 4 4 17 Apr(3) 24 Tue(3) 24 115 4 4 17 Apr(3) 25 Wed(4) 25 116 4 4 17 Apr(3) 26 Thu(5) 26 117 4 4 17 Apr(3) 27 Fri(6) 27 118 4 4 17 Apr(3) 28 Sat(7) 28 119 4 4 17 Apr(3) 29 Sun(1) 29 120 5 5 18 Apr(3) 30 Mon(2) 30 121 5 5 18 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- May(4) 1 Tue(3) 1 122 1 1 18 May(4) 2 Wed(4) 2 123 1 1 18 May(4) 3 Thu(5) 3 124 1 1 18 May(4) 4 Fri(6) 4 125 1 1 18 May(4) 5 Sat(7) 5 126 1 1 18 May(4) 6 Sun(1) 6 127 1 2 19 May(4) 7 Mon(2) 7 128 1 2 19 May(4) 8 Tue(3) 8 129 2 2 19 May(4) 9 Wed(4) 9 130 2 2 19 May(4) 10 Thu(5) 10 131 2 2 19 May(4) 11 Fri(6) 11 132 2 2 19 May(4) 12 Sat(7) 12 133 2 2 19 May(4) 13 Sun(1) 13 134 2 3 20 May(4) 14 Mon(2) 14 135 2 3 20 May(4) 15 Tue(3) 15 136 3 3 20 May(4) 16 Wed(4) 16 137 3 3 20 May(4) 17 Thu(5) 17 138 3 3 20 May(4) 18 Fri(6) 18 139 3 3 20 May(4) 19 Sat(7) 19 140 3 3 20 May(4) 20 Sun(1) 20 141 3 4 21 May(4) 21 Mon(2) 21 142 3 4 21 May(4) 22 Tue(3) 22 143 4 4 21 May(4) 23 Wed(4) 23 144 4 4 21 May(4) 24 Thu(5) 24 145 4 4 21 May(4) 25 Fri(6) 25 146 4 4 21 May(4) 26 Sat(7) 26 147 4 4 21 May(4) 27 Sun(1) 27 148 4 5 22 May(4) 28 Mon(2) 28 149 4 5 22 May(4) 29 Tue(3) 29 150 5 5 22 May(4) 30 Wed(4) 30 151 5 5 22 May(4) 31 Thu(5) 31 152 5 5 22 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Jun(5) 1 Fri(6) 1 153 1 1 22 Jun(5) 2 Sat(7) 2 154 1 1 22 Jun(5) 3 Sun(1) 3 155 1 2 23 Jun(5) 4 Mon(2) 4 156 1 2 23 Jun(5) 5 Tue(3) 5 157 1 2 23 Jun(5) 6 Wed(4) 6 158 1 2 23 Jun(5) 7 Thu(5) 7 159 1 2 23 Jun(5) 8 Fri(6) 8 160 2 2 23 Jun(5) 9 Sat(7) 9 161 2 2 23 Jun(5) 10 Sun(1) 10 162 2 3 24 Jun(5) 11 Mon(2) 11 163 2 3 24 Jun(5) 12 Tue(3) 12 164 2 3 24 Jun(5) 13 Wed(4) 13 165 2 3 24 Jun(5) 14 Thu(5) 14 166 2 3 24 Jun(5) 15 Fri(6) 15 167 3 3 24 Jun(5) 16 Sat(7) 16 168 3 3 24 Jun(5) 17 Sun(1) 17 169 3 4 25 Jun(5) 18 Mon(2) 18 170 3 4 25 Jun(5) 19 Tue(3) 19 171 3 4 25 Jun(5) 20 Wed(4) 20 172 3 4 25 Jun(5) 21 Thu(5) 21 173 3 4 25 Jun(5) 22 Fri(6) 22 174 4 4 25 Jun(5) 23 Sat(7) 23 175 4 4 25 Jun(5) 24 Sun(1) 24 176 4 5 26 Jun(5) 25 Mon(2) 25 177 4 5 26 Jun(5) 26 Tue(3) 26 178 4 5 26 Jun(5) 27 Wed(4) 27 179 4 5 26 Jun(5) 28 Thu(5) 28 180 4 5 26 Jun(5) 29 Fri(6) 29 181 5 5 26 Jun(5) 30 Sat(7) 30 182 5 5 26 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Jul(6) 1 Sun(1) 1 183 1 1 27 Jul(6) 2 Mon(2) 2 184 1 1 27 Jul(6) 3 Tue(3) 3 185 1 1 27 Jul(6) 4 Wed(4) 4 186 1 1 27 Jul(6) 5 Thu(5) 5 187 1 1 27 Jul(6) 6 Fri(6) 6 188 1 1 27 Jul(6) 7 Sat(7) 7 189 1 1 27 Jul(6) 8 Sun(1) 8 190 2 2 28 Jul(6) 9 Mon(2) 9 191 2 2 28 Jul(6) 10 Tue(3) 10 192 2 2 28 Jul(6) 11 Wed(4) 11 193 2 2 28 Jul(6) 12 Thu(5) 12 194 2 2 28 Jul(6) 13 Fri(6) 13 195 2 2 28 Jul(6) 14 Sat(7) 14 196 2 2 28 Jul(6) 15 Sun(1) 15 197 3 3 29 Jul(6) 16 Mon(2) 16 198 3 3 29 Jul(6) 17 Tue(3) 17 199 3 3 29 Jul(6) 18 Wed(4) 18 200 3 3 29 Jul(6) 19 Thu(5) 19 201 3 3 29 Jul(6) 20 Fri(6) 20 202 3 3 29 Jul(6) 21 Sat(7) 21 203 3 3 29 Jul(6) 22 Sun(1) 22 204 4 4 30 Jul(6) 23 Mon(2) 23 205 4 4 30 Jul(6) 24 Tue(3) 24 206 4 4 30 Jul(6) 25 Wed(4) 25 207 4 4 30 Jul(6) 26 Thu(5) 26 208 4 4 30 Jul(6) 27 Fri(6) 27 209 4 4 30 Jul(6) 28 Sat(7) 28 210 4 4 30 Jul(6) 29 Sun(1) 29 211 5 5 31 Jul(6) 30 Mon(2) 30 212 5 5 31 Jul(6) 31 Tue(3) 31 213 5 5 31 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Aug(7) 1 Wed(4) 1 214 1 1 31 Aug(7) 2 Thu(5) 2 215 1 1 31 Aug(7) 3 Fri(6) 3 216 1 1 31 Aug(7) 4 Sat(7) 4 217 1 1 31 Aug(7) 5 Sun(1) 5 218 1 2 32 Aug(7) 6 Mon(2) 6 219 1 2 32 Aug(7) 7 Tue(3) 7 220 1 2 32 Aug(7) 8 Wed(4) 8 221 2 2 32 Aug(7) 9 Thu(5) 9 222 2 2 32 Aug(7) 10 Fri(6) 10 223 2 2 32 Aug(7) 11 Sat(7) 11 224 2 2 32 Aug(7) 12 Sun(1) 12 225 2 3 33 Aug(7) 13 Mon(2) 13 226 2 3 33 Aug(7) 14 Tue(3) 14 227 2 3 33 Aug(7) 15 Wed(4) 15 228 3 3 33 Aug(7) 16 Thu(5) 16 229 3 3 33 Aug(7) 17 Fri(6) 17 230 3 3 33 Aug(7) 18 Sat(7) 18 231 3 3 33 Aug(7) 19 Sun(1) 19 232 3 4 34 Aug(7) 20 Mon(2) 20 233 3 4 34 Aug(7) 21 Tue(3) 21 234 3 4 34 Aug(7) 22 Wed(4) 22 235 4 4 34 Aug(7) 23 Thu(5) 23 236 4 4 34 Aug(7) 24 Fri(6) 24 237 4 4 34 Aug(7) 25 Sat(7) 25 238 4 4 34 Aug(7) 26 Sun(1) 26 239 4 5 35 Aug(7) 27 Mon(2) 27 240 4 5 35 Aug(7) 28 Tue(3) 28 241 4 5 35 Aug(7) 29 Wed(4) 29 242 5 5 35 Aug(7) 30 Thu(5) 30 243 5 5 35 Aug(7) 31 Fri(6) 31 244 5 5 35 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Sep(8) 1 Sat(7) 1 245 1 1 35 Sep(8) 2 Sun(1) 2 246 1 2 36 Sep(8) 3 Mon(2) 3 247 1 2 36 Sep(8) 4 Tue(3) 4 248 1 2 36 Sep(8) 5 Wed(4) 5 249 1 2 36 Sep(8) 6 Thu(5) 6 250 1 2 36 Sep(8) 7 Fri(6) 7 251 1 2 36 Sep(8) 8 Sat(7) 8 252 2 2 36 Sep(8) 9 Sun(1) 9 253 2 3 37 Sep(8) 10 Mon(2) 10 254 2 3 37 Sep(8) 11 Tue(3) 11 255 2 3 37 Sep(8) 12 Wed(4) 12 256 2 3 37 Sep(8) 13 Thu(5) 13 257 2 3 37 Sep(8) 14 Fri(6) 14 258 2 3 37 Sep(8) 15 Sat(7) 15 259 3 3 37 Sep(8) 16 Sun(1) 16 260 3 4 38 Sep(8) 17 Mon(2) 17 261 3 4 38 Sep(8) 18 Tue(3) 18 262 3 4 38 Sep(8) 19 Wed(4) 19 263 3 4 38 Sep(8) 20 Thu(5) 20 264 3 4 38 Sep(8) 21 Fri(6) 21 265 3 4 38 Sep(8) 22 Sat(7) 22 266 4 4 38 Sep(8) 23 Sun(1) 23 267 4 5 39 Sep(8) 24 Mon(2) 24 268 4 5 39 Sep(8) 25 Tue(3) 25 269 4 5 39 Sep(8) 26 Wed(4) 26 270 4 5 39 Sep(8) 27 Thu(5) 27 271 4 5 39 Sep(8) 28 Fri(6) 28 272 4 5 39 Sep(8) 29 Sat(7) 29 273 5 5 39 Sep(8) 30 Sun(1) 30 274 5 6 40 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Oct(9) 1 Mon(2) 1 275 1 1 40 Oct(9) 2 Tue(3) 2 276 1 1 40 Oct(9) 3 Wed(4) 3 277 1 1 40 Oct(9) 4 Thu(5) 4 278 1 1 40 Oct(9) 5 Fri(6) 5 279 1 1 40 Oct(9) 6 Sat(7) 6 280 1 1 40 Oct(9) 7 Sun(1) 7 281 1 2 41 Oct(9) 8 Mon(2) 8 282 2 2 41 Oct(9) 9 Tue(3) 9 283 2 2 41 Oct(9) 10 Wed(4) 10 284 2 2 41 Oct(9) 11 Thu(5) 11 285 2 2 41 Oct(9) 12 Fri(6) 12 286 2 2 41 Oct(9) 13 Sat(7) 13 287 2 2 41 Oct(9) 14 Sun(1) 14 288 2 3 42 Oct(9) 15 Mon(2) 15 289 3 3 42 Oct(9) 16 Tue(3) 16 290 3 3 42 Oct(9) 17 Wed(4) 17 291 3 3 42 Oct(9) 18 Thu(5) 18 292 3 3 42 Oct(9) 19 Fri(6) 19 293 3 3 42 Oct(9) 20 Sat(7) 20 294 3 3 42 Oct(9) 21 Sun(1) 21 295 3 4 43 Oct(9) 22 Mon(2) 22 296 4 4 43 Oct(9) 23 Tue(3) 23 297 4 4 43 Oct(9) 24 Wed(4) 24 298 4 4 43 Oct(9) 25 Thu(5) 25 299 4 4 43 Oct(9) 26 Fri(6) 26 300 4 4 43 Oct(9) 27 Sat(7) 27 301 4 4 43 Oct(9) 28 Sun(1) 28 302 4 5 44 Oct(9) 29 Mon(2) 29 303 5 5 44 Oct(9) 30 Tue(3) 30 304 5 5 44 Oct(9) 31 Wed(4) 31 305 5 5 44 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Nov(10) 1 Thu(5) 1 306 1 1 44 Nov(10) 2 Fri(6) 2 307 1 1 44 Nov(10) 3 Sat(7) 3 308 1 1 44 Nov(10) 4 Sun(1) 4 309 1 2 45 Nov(10) 5 Mon(2) 5 310 1 2 45 Nov(10) 6 Tue(3) 6 311 1 2 45 Nov(10) 7 Wed(4) 7 312 1 2 45 Nov(10) 8 Thu(5) 8 313 2 2 45 Nov(10) 9 Fri(6) 9 314 2 2 45 Nov(10) 10 Sat(7) 10 315 2 2 45 Nov(10) 11 Sun(1) 11 316 2 3 46 Nov(10) 12 Mon(2) 12 317 2 3 46 Nov(10) 13 Tue(3) 13 318 2 3 46 Nov(10) 14 Wed(4) 14 319 2 3 46 Nov(10) 15 Thu(5) 15 320 3 3 46 Nov(10) 16 Fri(6) 16 321 3 3 46 Nov(10) 17 Sat(7) 17 322 3 3 46 Nov(10) 18 Sun(1) 18 323 3 4 47 Nov(10) 19 Mon(2) 19 324 3 4 47 Nov(10) 20 Tue(3) 20 325 3 4 47 Nov(10) 21 Wed(4) 21 326 3 4 47 Nov(10) 22 Thu(5) 22 327 4 4 47 Nov(10) 23 Fri(6) 23 328 4 4 47 Nov(10) 24 Sat(7) 24 329 4 4 47 Nov(10) 25 Sun(1) 25 330 4 5 48 Nov(10) 26 Mon(2) 26 331 4 5 48 Nov(10) 27 Tue(3) 27 332 4 5 48 Nov(10) 28 Wed(4) 28 333 4 5 48 Nov(10) 29 Thu(5) 29 334 5 5 48 Nov(10) 30 Fri(6) 30 335 5 5 48 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Dec(11) 1 Sat(7) 1 336 1 1 48 Dec(11) 2 Sun(1) 2 337 1 2 49 Dec(11) 3 Mon(2) 3 338 1 2 49 Dec(11) 4 Tue(3) 4 339 1 2 49 Dec(11) 5 Wed(4) 5 340 1 2 49 Dec(11) 6 Thu(5) 6 341 1 2 49 Dec(11) 7 Fri(6) 7 342 1 2 49 Dec(11) 8 Sat(7) 8 343 2 2 49 Dec(11) 9 Sun(1) 9 344 2 3 50 Dec(11) 10 Mon(2) 10 345 2 3 50 Dec(11) 11 Tue(3) 11 346 2 3 50 Dec(11) 12 Wed(4) 12 347 2 3 50 Dec(11) 13 Thu(5) 13 348 2 3 50 Dec(11) 14 Fri(6) 14 349 2 3 50 Dec(11) 15 Sat(7) 15 350 3 3 50 Dec(11) 16 Sun(1) 16 351 3 4 51 Dec(11) 17 Mon(2) 17 352 3 4 51 Dec(11) 18 Tue(3) 18 353 3 4 51 Dec(11) 19 Wed(4) 19 354 3 4 51 Dec(11) 20 Thu(5) 20 355 3 4 51 Dec(11) 21 Fri(6) 21 356 3 4 51 Dec(11) 22 Sat(7) 22 357 4 4 51 Dec(11) 23 Sun(1) 23 358 4 5 52 Dec(11) 24 Mon(2) 24 359 4 5 52 Dec(11) 25 Tue(3) 25 360 4 5 52 Dec(11) 26 Wed(4) 26 361 4 5 52 Dec(11) 27 Thu(5) 27 362 4 5 52 Dec(11) 28 Fri(6) 28 363 4 5 52 Dec(11) 29 Sat(7) 29 364 5 5 52 Dec(11) 30 Sun(1) 30 365 5 6 1 Dec(11) 31 Mon(2) 31 366 5 6 1 ==================================================================== YEAR=2013 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Jan(0) 1 Tue(3) 1 1 1 1 1 Jan(0) 2 Wed(4) 2 2 1 1 1 Jan(0) 3 Thu(5) 3 3 1 1 1 Jan(0) 4 Fri(6) 4 4 1 1 1 Jan(0) 5 Sat(7) 5 5 1 1 1 Jan(0) 6 Sun(1) 6 6 1 2 2 Jan(0) 7 Mon(2) 7 7 1 2 2 Jan(0) 8 Tue(3) 8 8 2 2 2 Jan(0) 9 Wed(4) 9 9 2 2 2 Jan(0) 10 Thu(5) 10 10 2 2 2 Jan(0) 11 Fri(6) 11 11 2 2 2 Jan(0) 12 Sat(7) 12 12 2 2 2 Jan(0) 13 Sun(1) 13 13 2 3 3 Jan(0) 14 Mon(2) 14 14 2 3 3 Jan(0) 15 Tue(3) 15 15 3 3 3 Jan(0) 16 Wed(4) 16 16 3 3 3 Jan(0) 17 Thu(5) 17 17 3 3 3 Jan(0) 18 Fri(6) 18 18 3 3 3 Jan(0) 19 Sat(7) 19 19 3 3 3 Jan(0) 20 Sun(1) 20 20 3 4 4 Jan(0) 21 Mon(2) 21 21 3 4 4 Jan(0) 22 Tue(3) 22 22 4 4 4 Jan(0) 23 Wed(4) 23 23 4 4 4 Jan(0) 24 Thu(5) 24 24 4 4 4 Jan(0) 25 Fri(6) 25 25 4 4 4 Jan(0) 26 Sat(7) 26 26 4 4 4 Jan(0) 27 Sun(1) 27 27 4 5 5 Jan(0) 28 Mon(2) 28 28 4 5 5 Jan(0) 29 Tue(3) 29 29 5 5 5 Jan(0) 30 Wed(4) 30 30 5 5 5 Jan(0) 31 Thu(5) 31 31 5 5 5 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Feb(1) 1 Fri(6) 1 32 1 1 5 Feb(1) 2 Sat(7) 2 33 1 1 5 Feb(1) 3 Sun(1) 3 34 1 2 6 Feb(1) 4 Mon(2) 4 35 1 2 6 Feb(1) 5 Tue(3) 5 36 1 2 6 Feb(1) 6 Wed(4) 6 37 1 2 6 Feb(1) 7 Thu(5) 7 38 1 2 6 Feb(1) 8 Fri(6) 8 39 2 2 6 Feb(1) 9 Sat(7) 9 40 2 2 6 Feb(1) 10 Sun(1) 10 41 2 3 7 Feb(1) 11 Mon(2) 11 42 2 3 7 Feb(1) 12 Tue(3) 12 43 2 3 7 Feb(1) 13 Wed(4) 13 44 2 3 7 Feb(1) 14 Thu(5) 14 45 2 3 7 Feb(1) 15 Fri(6) 15 46 3 3 7 Feb(1) 16 Sat(7) 16 47 3 3 7 Feb(1) 17 Sun(1) 17 48 3 4 8 Feb(1) 18 Mon(2) 18 49 3 4 8 Feb(1) 19 Tue(3) 19 50 3 4 8 Feb(1) 20 Wed(4) 20 51 3 4 8 Feb(1) 21 Thu(5) 21 52 3 4 8 Feb(1) 22 Fri(6) 22 53 4 4 8 Feb(1) 23 Sat(7) 23 54 4 4 8 Feb(1) 24 Sun(1) 24 55 4 5 9 Feb(1) 25 Mon(2) 25 56 4 5 9 Feb(1) 26 Tue(3) 26 57 4 5 9 Feb(1) 27 Wed(4) 27 58 4 5 9 Feb(1) 28 Thu(5) 28 59 4 5 9 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Mar(2) 1 Fri(6) 1 60 1 1 9 Mar(2) 2 Sat(7) 2 61 1 1 9 Mar(2) 3 Sun(1) 3 62 1 2 10 Mar(2) 4 Mon(2) 4 63 1 2 10 Mar(2) 5 Tue(3) 5 64 1 2 10 Mar(2) 6 Wed(4) 6 65 1 2 10 Mar(2) 7 Thu(5) 7 66 1 2 10 Mar(2) 8 Fri(6) 8 67 2 2 10 Mar(2) 9 Sat(7) 9 68 2 2 10 Mar(2) 10 Sun(1) 10 69 2 3 11 Mar(2) 11 Mon(2) 11 70 2 3 11 Mar(2) 12 Tue(3) 12 71 2 3 11 Mar(2) 13 Wed(4) 13 72 2 3 11 Mar(2) 14 Thu(5) 14 73 2 3 11 Mar(2) 15 Fri(6) 15 74 3 3 11 Mar(2) 16 Sat(7) 16 75 3 3 11 Mar(2) 17 Sun(1) 17 76 3 4 12 Mar(2) 18 Mon(2) 18 77 3 4 12 Mar(2) 19 Tue(3) 19 78 3 4 12 Mar(2) 20 Wed(4) 20 79 3 4 12 Mar(2) 21 Thu(5) 21 80 3 4 12 Mar(2) 22 Fri(6) 22 81 4 4 12 Mar(2) 23 Sat(7) 23 82 4 4 12 Mar(2) 24 Sun(1) 24 83 4 5 13 Mar(2) 25 Mon(2) 25 84 4 5 13 Mar(2) 26 Tue(3) 26 85 4 5 13 Mar(2) 27 Wed(4) 27 86 4 5 13 Mar(2) 28 Thu(5) 28 87 4 5 13 Mar(2) 29 Fri(6) 29 88 5 5 13 Mar(2) 30 Sat(7) 30 89 5 5 13 Mar(2) 31 Sun(1) 31 90 5 6 14 -------------------------------------------------------------------- Month(MONTH) DAY_OF_MONTH WEEK_OF_MONTH DATE DAY_OF_YEAR WEEK_OF_YEAR Week(DAY_OF_WEEK) DAY_OF_WEEK_IN_MONTH -------------------------------------------------------------------- Apr(3) 1 Mon(2) 1 91 1 1 14 Apr(3) 2 Tue(3) 2 92 1 1 14 Apr(3) 3 Wed(4) 3 93 1 1 14 Apr(3) 4 Thu(5) 4 94 1 1 14 Apr(3) 5 Fri(6) 5 95 1 1 14 Apr(3) 6 Sat(7) 6 96 1 1 14 Apr(3) 7 Sun(1) 7 97 1 2 15 Apr(3) 8 Mon(2) 8 98 2 2 15 Apr(3) 9 Tue(3) 9 99 2 2 15 Apr(3) 10 Wed(4) 10 100 2 2 15 Apr(3) 11 Thu(5) 11 101 2 2 15 Apr(3) 12 Fri(6) 12 102 2 2 15 Apr(3) 13 Sat(7) 13 103 2 2 15 Apr(3) 14 Sun(1) 14 104 2 3 16 Apr(3) 15 Mon(2) 15 105 3 3 16 Apr(3) 16 Tue(3) 16 106 3 3 16 Apr(3) 17 Wed(4) 17 107 3 3 16 Apr(3) 18 Thu(5) 18 108 3 3 16 Apr(3) 19 Fri(6) 19 109 3 3 16 Apr(3) 20 Sat(7) 20 110 3 3 16 Apr(3) 21 Sun(1) 21 111 3 4 17 Apr(3) 22 Mon(2) 22 112 4 4 17 Apr(3) 23 Tue(3) 23 113 4 4 17 Apr(3) 24 Wed(4) 24 114 4 4 17 Apr(3) 25 Thu(5) 25 115 4 4 17 Apr(3) 26 Fri(6) 26 116 4 4 17 Apr(3) 27 Sat(7) 27 117 4 4 17 Apr(3) 28 Sun(1) 28 118 4 5 18 Apr(3) 29 Mon(2) 29 119 5 5 18 Apr(3) 30 Tue(3) 30 120 5 5 18
2 source of com.gimslab.calendar_test.CalTest.java
package com.gimslab.calendar_test; import java.util.Calendar; import java.util.Locale; public class CalTest { /** * @param args */ public static void main(String[] args) { new CalTest().printOut(); } private void printOut() { printCalendar(2011, 11, 1, 2013, 3, 31); } private void printCalendar(int syear, int smonth, int sdate, int eyear, int emonth, int edate) { Calendar c = Calendar.getInstance(); boolean firstLoop = true; for (int year = syear; year <= eyear; year++) { c.set(Calendar.YEAR, year); System.out .println("===================================================================="); System.out.println("YEAR=" + c.get(Calendar.YEAR)); for (int month = 0; month <= 11; month++) { if (firstLoop) month = smonth; c.set(Calendar.MONTH, month); for (int date = 1; date <= getLastDateOf(year, month); date++) { if (firstLoop) { firstLoop = false; date = sdate; } c.set(Calendar.DATE, date); if (date == 1) printTitle(); printCalendarData(c); if (year == eyear && month == emonth && date == edate) break; } if (year == eyear && month == emonth) break; } } } private void printTitle() { System.out .println("--------------------------------------------------------------------"); print("Month(MONTH)"); print(""); print("DAY_OF_MONTH"); print(""); print("WEEK_OF_MONTH"); System.out.println(); print(""); print("DATE"); print(""); print(""); print("DAY_OF_YEAR"); print(""); print("WEEK_OF_YEAR"); System.out.println(); print(""); print(""); print("Week(DAY_OF_WEEK)"); print("DAY_OF_WEEK_IN_MONTH"); System.out.println(); System.out .println("--------------------------------------------------------------------"); } private void printCalendarData(Calendar c) { print(c.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.US) + "(" + c.get(Calendar.MONTH) + ")"); print(c.get(Calendar.DATE)); print(c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.SHORT, Locale.US) + "(" + c.get(Calendar.DAY_OF_WEEK) + ")"); print(c.get(Calendar.DAY_OF_MONTH)); print(c.get(Calendar.DAY_OF_YEAR)); print(c.get(Calendar.DAY_OF_WEEK_IN_MONTH)); print(c.get(Calendar.WEEK_OF_MONTH)); print(c.get(Calendar.WEEK_OF_YEAR)); System.out.println(); } private void print(String str) { System.out.print(str + "\t"); } private void print(int i) { print(Integer.toString(i)); } private int getLastDateOf(int year, int month) { Calendar c = Calendar.getInstance(); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month); return c.getActualMaximum(Calendar.DAY_OF_MONTH); } }
'java' 카테고리의 다른 글
Add Servlet Context and Swagger on Spring Boot (0) | 2021.08.01 |
---|---|
제11회 한국자바개발자 컨퍼런스 축하합니다 (0) | 2011.06.09 |
여러 jar 파일에서 원하는 파일 찾기, jar 파일 내용 검색 (0) | 2011.04.11 |
jar 파일들 중에서 원하는 파일 찾기 >cat findinjar.sh (0) | 2009.04.16 |
클래스가 어떤 리소스에서 로드되었는지 (0) | 2009.04.16 |