DnT.java
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100: package xeij;
101:
102: import java.lang.*;
103:
104: public class DnT {
105:
106: protected static final String[] DNT_ENMON3_MONT = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
107: protected static final String[] DNT_ENMON4_MONT = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
108: protected static final String[] DNT_ENWDAY3_WDAY = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
109: protected static final String[] DNT_ENWDAY6_WDAY = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };
110: protected static final String[] DNT_JAWDAY1_WDAY = { "日", "月", "火", "水", "木", "金", "土" };
111: protected static final String[] DNT_JAWDAY3_WDAY = { "日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日" };
112: protected static final String[] DNT_JALCMONT_MONT = { "睦月", "如月", "弥生", "卯月", "皐月", "水無月", "文月", "葉月", "長月", "神無月", "霜月", "師走" };
113:
114:
115:
116:
117:
118:
119: public static int dntFdiv (int x, int y) {
120: if (true) {
121: return (int) Math.floor ((double) x / (double) y);
122: } else {
123: int q = x / y;
124: return 0 <= (x ^ y) || x - q * y == 0 ? q : q - 1;
125: }
126: }
127: public static long dntFdiv (long x, long y) {
128:
129: long q = x / y;
130: return 0L <= (x ^ y) || x - q * y == 0L ? q : q - 1L;
131: }
132: public static double dntFdiv (double x, double y) {
133: return Math.floor (x / y);
134: }
135:
136:
137:
138:
139:
140:
141: public static int dntFrem (int x, int y) {
142: if (false) {
143: return (int) ((double) x - Math.floor ((double) x / (double) y) * (double) y);
144: } else if (false) {
145: double u = (double) x;
146: double v = (double) y;
147: return (int) (u - Math.floor (u / v) * v);
148: } else {
149: int r = x % y;
150: return 0 <= (x ^ y) || r == 0 ? r : r + y;
151: }
152: }
153: public static long dntFrem (long x, long y) {
154:
155: long r = x % y;
156: return 0L <= (x ^ y) || r == 0L ? r : r + y;
157: }
158: public static double dntFrem (double x, double y) {
159: return x - Math.floor (x / y) * y;
160: }
161:
162:
163:
164:
165:
166:
167:
168: public static int dntCdayCmil (long cmil) {
169: return (int) dntFdiv (cmil, 86400000L);
170: }
171:
172:
173:
174: public static int dntCdayCsec (long csec) {
175: return (int) dntFdiv (csec, 86400L);
176: }
177:
178:
179:
180: public static int dntCdayDate (int date) {
181:
182: return dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63);
183: }
184:
185:
186:
187: public static int dntCdayDttm (long dttm) {
188:
189: int date = (int) (dttm >> 32);
190:
191: return dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63);
192: }
193:
194:
195:
196: public static int dntCdayNow () {
197:
198: return (int) dntFdiv (dntCmilNow (), 86400000L);
199: }
200:
201:
202:
203:
204: public static int dntCdayYearMontMday (int year, int mont, int mday) {
205: if (mont < 3) {
206: year--;
207: mont += 12;
208: }
209: int cday = ((int) Math.floor ((double) year * 365.25) +
210: (int) Math.floor ((double) (mont - 2) * 30.59) +
211: mday - 719501);
212: if (-141417 <= cday) {
213: cday += dntFdiv (year, 400) - dntFdiv (year, 100) + 2;
214: }
215: return cday;
216: }
217:
218:
219:
220:
221:
222:
223:
224: public static long dntCmilCday (int cday) {
225: return (long) cday * 86400000L;
226: }
227:
228:
229:
230: public static long dntCmilCdayDmil (int cday,
231: int dmil) {
232:
233: return (long) cday * 86400000L + (long) dmil;
234: }
235:
236:
237:
238: public static long dntCmilCdayDsec (int cday,
239: int dsec) {
240:
241: return (long) cday * 86400000L + (long) (dsec * 1000);
242: }
243:
244:
245:
246: public static long dntCmilCdayHourMinuSeco (int cday,
247: int hour, int minu, int seco) {
248:
249:
250: return ((long) cday * 86400000L +
251: (long) (hour * 3600000 + minu * 60000 + seco * 1000));
252: }
253:
254:
255:
256: public static long dntCmilCdayHourMinuSecoMill (int cday,
257: int hour, int minu, int seco, int mill) {
258:
259:
260: return ((long) cday * 86400000L +
261: (long) (hour * 3600000 + minu * 60000 + seco * 1000 + mill));
262: }
263:
264:
265:
266: public static long dntCmilCdayTime (int cday,
267: int time) {
268:
269:
270: return ((long) cday * 86400000L +
271: (long) ((time >> 22) * 3600000 + (time >> 16 & 63) * 60000 + (time >> 10 & 63) * 1000 + (time & 1023)));
272: }
273:
274:
275:
276: public static long dntCmilCsec (long csec) {
277: return csec * 1000L;
278: }
279:
280:
281:
282: public static long dntCmilDate (int date) {
283:
284: return (long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L;
285: }
286:
287:
288:
289: public static long dntCmilDateDmil (int date,
290: int dmil) {
291:
292:
293: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
294: (long) dmil);
295: }
296:
297:
298:
299: public static long dntCmilDateDsec (int date,
300: int dsec) {
301:
302:
303: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
304: (long) (dsec * 1000));
305: }
306:
307:
308:
309: public static long dntCmilDateHourMinuSeco (int date,
310: int hour, int minu, int seco) {
311:
312:
313: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
314: (long) (hour * 3600000 + minu * 60000 + seco * 1000));
315: }
316:
317:
318:
319: public static long dntCmilDateHourMinuSecoMill (int date,
320: int hour, int minu, int seco, int mill) {
321:
322:
323: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
324: (long) (hour * 3600000 + minu * 60000 + seco * 1000 + mill));
325: }
326:
327:
328:
329: public static long dntCmilDateTime (int date,
330: int time) {
331:
332:
333: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
334: (long) ((time >> 22) * 3600000 + (time >> 16 & 63) * 60000 + (time >> 10 & 63) * 1000 + (time & 1023)));
335: }
336:
337:
338:
339: public static long dntCmilDttm (long dttm) {
340:
341:
342: int date = (int) (dttm >> 32);
343: int time = (int) dttm;
344:
345:
346: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400000L +
347: (long) ((time >> 22) * 3600000 + (time >> 16 & 63) * 60000 + (time >> 10 & 63) * 1000 + (time & 1023)));
348: }
349:
350:
351:
352: public static long dntCmilNow () {
353: return System.currentTimeMillis ();
354: }
355:
356:
357:
358: public static long dntCmilYearMontMday (int year, int mont, int mday) {
359:
360: return (long) dntCdayYearMontMday (year, mont, mday) * 86400000L;
361: }
362:
363:
364:
365: public static long dntCmilYearMontMdayDmil (int year, int mont, int mday,
366: int dmil) {
367:
368:
369: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400000L +
370: (long) dmil);
371: }
372:
373:
374:
375: public static long dntCmilYearMontMdayDsec (int year, int mont, int mday,
376: int dsec) {
377:
378:
379: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400000L +
380: (long) (dsec * 1000));
381: }
382:
383:
384:
385: public static long dntCmilYearMontMdayHourMinuSeco (int year, int mont, int mday,
386: int hour, int minu, int seco) {
387:
388:
389: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400000L +
390: (long) (hour * 3600000 + minu * 60000 + seco * 1000));
391: }
392:
393:
394:
395: public static long dntCmilYearMontMdayHourMinuSecoMill (int year, int mont, int mday,
396: int hour, int minu, int seco, int mill) {
397:
398:
399: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400000L +
400: (long) (hour * 3600000 + minu * 60000 + seco * 1000 + mill));
401: }
402:
403:
404:
405: public static long dntCmilYearMontMdayTime (int year, int mont, int mday,
406: int time) {
407:
408:
409: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400000L +
410: (long) ((time >> 22) * 3600000 + (time >> 16 & 63) * 60000 + (time >> 10 & 63) * 1000 + (time & 1023)));
411: }
412:
413:
414:
415:
416:
417:
418:
419: public static long dntCsecCday (int cday) {
420: return (long) cday * 86400L;
421: }
422:
423:
424:
425: public static long dntCsecCdayDmil (int cday,
426: int dmil) {
427:
428:
429: return ((long) cday * 86400L +
430: (long) dntFdiv (dmil, 1000));
431: }
432:
433:
434:
435: public static long dntCsecCdayDsec (int cday,
436: int dsec) {
437:
438:
439: return ((long) cday * 86400L +
440: (long) dsec);
441: }
442:
443:
444:
445: public static long dntCsecCdayHourMinuSeco (int cday,
446: int hour, int minu, int seco) {
447:
448:
449: return ((long) cday * 86400L +
450: (long) (hour * 3600 + minu * 60 + seco));
451: }
452:
453:
454:
455: public static long dntCsecCdayTime (int cday,
456: int time) {
457:
458:
459: return ((long) cday * 86400L +
460: (long) ((time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63)));
461: }
462:
463:
464:
465: public static long dntCsecCmil (long cmil) {
466: return dntFdiv (cmil, 1000L);
467: }
468:
469:
470:
471: public static long dntCsecDate (int date) {
472:
473: return (long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L;
474: }
475:
476:
477:
478: public static long dntCsecDateDmil (int date,
479: int dmil) {
480:
481:
482: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L +
483: (long) dntFdiv (dmil, 1000));
484: }
485:
486:
487:
488: public static long dntCsecDateDsec (int date,
489: int dsec) {
490:
491:
492: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L +
493: (long) dsec);
494: }
495:
496:
497:
498: public static long dntCsecDateHourMinuSeco (int date,
499: int hour, int minu, int seco) {
500:
501:
502: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L +
503: (long) (hour * 3600 + minu * 60 + seco));
504: }
505:
506:
507:
508: public static long dntCsecDateTime (int date,
509: int time) {
510:
511:
512: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L +
513: (long) ((time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63)));
514: }
515:
516:
517:
518: public static long dntCsecDttm (long dttm) {
519:
520:
521: int date = (int) (dttm >> 32);
522: int time = (int) dttm;
523:
524:
525: return ((long) dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) * 86400L +
526: (long) ((time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63)));
527: }
528:
529:
530:
531: public static long dntCsecNow () {
532:
533: return dntFdiv (System.currentTimeMillis (), 1000L);
534: }
535:
536:
537:
538: public static long dntCsecYearMontMday (int year, int mont, int mday) {
539:
540: return (long) dntCdayYearMontMday (year, mont, mday) * 86400L;
541: }
542:
543:
544:
545: public static long dntCsecYearMontMdayDmil (int year, int mont, int mday,
546: int dmil) {
547:
548:
549: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400L +
550: (long) dntFdiv (dmil, 1000));
551: }
552:
553:
554:
555: public static long dntCsecYearMontMdayDsec (int year, int mont, int mday,
556: int dsec) {
557:
558:
559: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400L +
560: (long) dsec);
561: }
562:
563:
564:
565: public static long dntCsecYearMontMdayHourMinuSeco (int year, int mont, int mday,
566: int hour, int minu, int seco) {
567:
568:
569: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400L +
570: (long) (hour * 3600 + minu * 60 + seco));
571: }
572:
573:
574:
575: public static long dntCsecYearMontMdayTime (int year, int mont, int mday,
576: int time) {
577:
578:
579: return ((long) dntCdayYearMontMday (year, mont, mday) * 86400L +
580: (long) ((time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63)));
581: }
582:
583:
584:
585:
586:
587:
588:
589: public static int dntDateCday (int cday) {
590: int y400;
591: int y100;
592: if (cday < -141427) {
593: cday += 719470;
594: y400 = 0;
595: y100 = 0;
596: } else {
597: cday += 719468;
598: y400 = dntFdiv (cday, 146097);
599: cday -= y400 * 146097;
600: y100 = dntFdiv (cday, 36524);
601: if (3 < y100) {
602: y100 = 3;
603: }
604: cday -= y100 * 36524;
605: }
606: int y4 = dntFdiv (cday, 1461);
607: cday -= y4 * 1461;
608: int y1 = dntFdiv (cday, 365);
609: if (3 < y1) {
610: y1 = 3;
611: }
612: cday = (cday - 365 * y1) * 10 + 922;
613: int year = y400 * 400 + y100 * 100 + y4 * 4 + y1;
614: int mont = dntFdiv (cday, 306);
615: int mday = dntFdiv (cday - mont * 306, 10) + 1;
616: if (12 < mont) {
617: year++;
618: mont -= 12;
619: }
620: return dntDateYearMontMday (year, mont, mday);
621: }
622:
623:
624:
625: public static int dntDateCmil (long cmil) {
626:
627: return dntDateCday ((int) dntFdiv (cmil, 86400000L));
628: }
629:
630:
631:
632: public static int dntDateCsec (long csec) {
633:
634: return dntDateCday ((int) dntFdiv (csec, 86400L));
635: }
636:
637:
638:
639: public static int dntDateDttm (long dttm) {
640: return (int) (dttm >> 32);
641: }
642:
643:
644:
645: public static int dntDateNow () {
646:
647: return dntDateCday ((int) dntFdiv (System.currentTimeMillis (), 86400000L));
648: }
649:
650:
651:
652: public static int dntDateYearMontMday (int year, int mont, int mday) {
653: return year << 10 | (mont & 15) << 6 | mday & 63;
654: }
655:
656:
657:
658:
659:
660:
661:
662: public static int dntDmilCmil (long cmil) {
663: return (int) dntFrem (cmil, 86400000L);
664: }
665:
666:
667:
668: public static int dntDmilCsec (long csec) {
669:
670: return (int) dntFrem (csec, 86400L) * 1000;
671: }
672:
673:
674:
675: public static int dntDmilDsec (int dsec) {
676: return dsec * 1000;
677: }
678:
679:
680:
681: public static int dntDmilDttm (long dttm) {
682:
683: return ((int) dttm >> 22) * 3600 + ((int) dttm >> 16 & 63) * 60 + ((int) dttm >> 10 & 63) + ((int) dttm & 1023);
684: }
685:
686:
687:
688: public static int dntDmilHourMinuSeco (int hour, int minu, int seco) {
689: return hour * 3600000 + minu * 60000 + seco * 1000;
690: }
691:
692:
693:
694: public static int dntDmilHourMinuSecoMill (int hour, int minu, int seco, int mill) {
695: return hour * 3600000 + minu * 60000 + seco * 1000 + mill;
696: }
697:
698:
699:
700: public static int dntDmilNow () {
701:
702: return (int) dntFrem (System.currentTimeMillis (), 86400000L);
703: }
704:
705:
706:
707: public static int dntDmilTime (int time) {
708:
709: return (time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63) + (time & 1023);
710: }
711:
712:
713:
714:
715:
716:
717:
718: public static int dntDsecCmil (long cmil) {
719:
720: return dntFdiv ((int) dntFrem (cmil, 86400000L), 1000);
721: }
722:
723:
724:
725: public static int dntDsecCsec (long csec) {
726: return (int) dntFrem (csec, 86400L);
727: }
728:
729:
730:
731: public static int dntDsecDmil (int dmil) {
732: return dntFdiv (dmil, 1000);
733: }
734:
735:
736:
737: public static int dntDsecDttm (long dttm) {
738:
739: return ((int) dttm >> 22) * 3600 + ((int) dttm >> 16 & 63) * 60 + ((int) dttm >> 10 & 63);
740: }
741:
742:
743:
744: public static int dntDsecHourMinuSeco (int hour, int minu, int seco) {
745: return hour * 3600 + minu * 60 + seco;
746: }
747:
748:
749:
750: public static int dntDsecNow () {
751:
752: return dntFdiv ((int) dntFrem (System.currentTimeMillis (), 86400000L), 1000);
753: }
754:
755:
756:
757: public static int dntDsecTime (int time) {
758:
759: return (time >> 22) * 3600 + (time >> 16 & 63) * 60 + (time >> 10 & 63);
760: }
761:
762:
763:
764:
765:
766:
767:
768: public static long dntDttmCday (int cday) {
769:
770: return (long) dntDateCday (cday) << 32;
771: }
772:
773:
774:
775: public static long dntDttmCdayDmil (int cday,
776: int dmil) {
777:
778:
779: return ((long) dntDateCday (cday) << 32 |
780: (long) dntTimeDmil (dmil) & 0xffffffffL);
781: }
782:
783:
784:
785: public static long dntDttmCdayDsec (int cday,
786: int dsec) {
787:
788:
789: return ((long) dntDateCday (cday) << 32 |
790: (long) dntTimeDsec (dsec) & 0xffffffffL);
791: }
792:
793:
794:
795: public static long dntDttmCdayHourMinuSeco (int cday,
796: int hour, int minu, int seco) {
797:
798:
799: return ((long) dntDateCday (cday) << 32 |
800: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10) & 0xffffffffL);
801: }
802:
803:
804:
805: public static long dntDttmCdayHourMinuSecoMill (int cday,
806: int hour, int minu, int seco, int mill) {
807:
808:
809: return ((long) dntDateCday (cday) << 32 |
810: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10 | mill & 1023) & 0xffffffffL);
811: }
812:
813:
814:
815: public static long dntDttmCdayTime (int cday,
816: int time) {
817:
818:
819: return ((long) dntDateCday (cday) << 32 |
820: (long) time & 0xffffffffL);
821: }
822:
823:
824:
825: public static long dntDttmCmil (long cmil) {
826:
827:
828: return ((long) dntDateCday ((int) dntFdiv (cmil, 86400000L)) << 32 |
829: (long) dntTimeDmil ((int) dntFrem (cmil, 86400000L)) & 0xffffffffL);
830: }
831:
832:
833:
834: public static long dntDttmCsec (long csec) {
835:
836:
837: return ((long) dntDateCday ((int) dntFdiv (csec, 86400L)) << 32 |
838: (long) dntTimeDsec ((int) dntFrem (csec, 86400L)) & 0xffffffffL);
839: }
840:
841:
842:
843: public static long dntDttmDate (int date) {
844: return (long) date << 32;
845: }
846:
847:
848:
849: public static long dntDttmDateDmil (int date,
850: int dmil) {
851:
852:
853: return ((long) date << 32 |
854: (long) dntTimeDmil (dmil) & 0xffffffffL);
855: }
856:
857:
858:
859: public static long dntDttmDateDsec (int date,
860: int dsec) {
861:
862:
863: return ((long) date << 32 |
864: (long) dntTimeDsec (dsec) & 0xffffffffL);
865: }
866:
867:
868:
869: public static long dntDttmDateHourMinuSeco (int date,
870: int hour, int minu, int seco) {
871:
872:
873: return ((long) date << 32 |
874: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10) & 0xffffffffL);
875: }
876:
877:
878:
879: public static long dntDttmDateHourMinuSecoMill (int date,
880: int hour, int minu, int seco, int mill) {
881:
882:
883: return ((long) date << 32 |
884: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10 | mill & 1023) & 0xffffffffL);
885: }
886:
887:
888:
889: public static long dntDttmDateTime (int date,
890: int time) {
891: return ((long) date << 32 |
892: (long) time & 0xffffffffL);
893: }
894:
895:
896:
897: public static long dntDttmNow () {
898:
899: long cmil = System.currentTimeMillis ();
900: return ((long) dntDateCday ((int) dntFdiv (cmil, 86400000L)) << 32 |
901: (long) dntTimeDsec ((int) dntFrem (cmil, 86400000L)) & 0xffffffffL);
902: }
903:
904:
905:
906: public static long dntDttmYearMontMday (int year, int mont, int mday) {
907:
908: return (long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32;
909: }
910:
911:
912:
913: public static long dntDttmYearMontMdayDmil (int year, int mont, int mday,
914: int dmil) {
915:
916:
917: return ((long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32 |
918: (long) dntTimeDmil (dmil) & 0xffffffffL);
919: }
920:
921:
922:
923: public static long dntDttmYearMontMdayDsec (int year, int mont, int mday,
924: int dsec) {
925:
926:
927: return ((long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32 |
928: (long) dntTimeDsec (dsec) & 0xffffffffL);
929: }
930:
931:
932:
933: public static long dntDttmYearMontMdayHourMinuSeco (int year, int mont, int mday,
934: int hour, int minu, int seco) {
935:
936:
937: return ((long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32 |
938: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10) & 0xffffffffL);
939: }
940:
941:
942:
943: public static long dntDttmYearMontMdayHourMinuSecoMill (int year, int mont, int mday,
944: int hour, int minu, int seco, int mill) {
945:
946:
947: return ((long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32 |
948: (long) (hour << 22 | (minu & 63) << 16 | (seco & 63) << 10 | mill & 1023) & 0xffffffffL);
949: }
950:
951:
952:
953: public static long dntDttmYearMontMdayTime (int year, int mont, int mday,
954: int time) {
955:
956:
957: return ((long) (year << 10 | (mont & 15) << 6 | mday & 63) << 32 |
958: (long) time & 0xffffffffL);
959: }
960:
961:
962:
963:
964:
965:
966:
967: public static int dntHourCmil (long cmil) {
968:
969:
970:
971: return (int) (dntFrem (cmil, 86400000L) * 39093747L >>> 47);
972: }
973:
974:
975:
976: public static int dntHourCsec (long csec) {
977:
978:
979:
980: return (int) (dntFrem (csec, 86400L) * 37283L >>> 27);
981: }
982:
983:
984:
985: public static int dntHourDmil (int dmil) {
986: return dntFdiv (dmil, 3600000);
987: }
988:
989:
990:
991: public static int dntHourDsec (int dsec) {
992: return dntFdiv (dsec, 3600);
993: }
994:
995:
996:
997: public static int dntHourDttm (long dttm) {
998: return (int) dttm >> 22;
999: }
1000:
1001:
1002:
1003: public static int dntHourNow () {
1004:
1005:
1006:
1007:
1008: return (int) (dntFrem (System.currentTimeMillis (), 86400000L) * 39093747L >>> 47);
1009: }
1010:
1011:
1012:
1013: public static int dntHourTime (int time) {
1014: return time >> 22;
1015: }
1016:
1017:
1018:
1019:
1020:
1021:
1022:
1023: public static int dntMdayCday (int cday) {
1024:
1025: return dntDateCday (cday) & 63;
1026: }
1027:
1028:
1029:
1030: public static int dntMdayCmil (long cmil) {
1031:
1032: return dntDateCday ((int) dntFdiv (cmil, 86400000L)) & 63;
1033: }
1034:
1035:
1036:
1037: public static int dntMdayCsec (long csec) {
1038:
1039: return dntDateCday ((int) dntFdiv (csec, 86400L)) & 63;
1040: }
1041:
1042:
1043:
1044: public static int dntMdayDate (int date) {
1045: return date & 63;
1046: }
1047:
1048:
1049:
1050: public static int dntMdayDttm (long dttm) {
1051: return (int) (dttm >> 32) & 63;
1052: }
1053:
1054:
1055:
1056: public static int dntMdayNow () {
1057:
1058: return dntDateCday ((int) dntFdiv (System.currentTimeMillis (), 86400000L)) & 63;
1059: }
1060:
1061:
1062:
1063:
1064:
1065:
1066:
1067: public static int dntMillCmil (long cmil) {
1068: return (int) dntFrem (cmil, 1000L);
1069: }
1070:
1071:
1072:
1073: public static int dntMillDmil (int dmil) {
1074: return dntFrem (dmil, 1000);
1075: }
1076:
1077:
1078:
1079: public static int dntMillDttm (long dttm) {
1080: return (int) dttm & 1023;
1081: }
1082:
1083:
1084:
1085: public static int dntMillNow () {
1086:
1087: return (int) dntFrem (System.currentTimeMillis (), 1000L);
1088: }
1089:
1090:
1091:
1092: public static int dntMillTime (int time) {
1093: return time & 1023;
1094: }
1095:
1096:
1097:
1098:
1099:
1100:
1101:
1102: public static int dntMinuCmil (long cmil) {
1103:
1104:
1105:
1106: return (int) (dntFrem (cmil, 3600000L) * 4581299L >>> 38);
1107: }
1108:
1109:
1110:
1111: public static int dntMinuCsec (long csec) {
1112:
1113:
1114:
1115: return (int) dntFrem (csec, 3600L) * 2185 >>> 17;
1116: }
1117:
1118:
1119:
1120: public static int dntMinuDmil (int dmil) {
1121:
1122:
1123:
1124: return (int) ((long) dntFrem (dmil, 3600000) * 4581299L >>> 38);
1125: }
1126:
1127:
1128:
1129: public static int dntMinuDsec (int dsec) {
1130:
1131:
1132:
1133: return dntFrem (dsec, 3600) * 2185 >>> 17;
1134: }
1135:
1136:
1137:
1138: public static int dntMinuDttm (long dttm) {
1139: return (int) dttm >> 16 & 63;
1140: }
1141:
1142:
1143:
1144: public static int dntMinuNow () {
1145:
1146:
1147:
1148:
1149: return (int) (dntFrem (System.currentTimeMillis (), 3600000L) * 4581299L >>> 38);
1150: }
1151:
1152:
1153:
1154: public static int dntMinuTime (int time) {
1155: return time >> 16 & 63;
1156: }
1157:
1158:
1159:
1160:
1161:
1162:
1163:
1164: public static int dntMontCday (int cday) {
1165:
1166: return dntDateCday (cday) >> 6 & 15;
1167: }
1168:
1169:
1170:
1171: public static int dntMontCmil (long cmil) {
1172:
1173: return dntDateCday ((int) dntFdiv (cmil, 86400000L)) >> 6 & 15;
1174: }
1175:
1176:
1177:
1178: public static int dntMontCsec (long csec) {
1179:
1180: return dntDateCday ((int) dntFdiv (csec, 86400L)) >> 6 & 15;
1181: }
1182:
1183:
1184:
1185: public static int dntMontDate (int date) {
1186: return date >> 6 & 15;
1187: }
1188:
1189:
1190:
1191: public static int dntMontDttm (long dttm) {
1192: return (int) (dttm >> 38) & 15;
1193: }
1194:
1195:
1196:
1197: public static int dntMontNow () {
1198:
1199: return dntDateCday ((int) dntFdiv (System.currentTimeMillis (), 86400000L)) >> 6 & 15;
1200: }
1201:
1202:
1203:
1204:
1205:
1206:
1207:
1208: public static String dntSdtCday (int cday) {
1209: return dntSdtDate (dntDateCday (cday));
1210: }
1211:
1212:
1213:
1214: public static String dntSdtCmil (long cmil) {
1215: return dntSdtDate (dntDateCmil (cmil));
1216: }
1217:
1218:
1219:
1220: public static String dntSdtCsec (long csec) {
1221: return dntSdtDate (dntDateCsec (csec));
1222: }
1223:
1224:
1225:
1226: public static String dntSdtDate (int date) {
1227:
1228: return dntSdtYearMontMday (date >> 10, date >> 6 & 15, date & 63);
1229: }
1230:
1231:
1232:
1233: public static String dntSdtDttm (long dttm) {
1234:
1235: return dntSdtDate ((int) (dttm >> 32));
1236: }
1237:
1238:
1239:
1240: public static String dntSdtNow () {
1241: return dntSdtDate (dntDateNow ());
1242: }
1243:
1244:
1245:
1246: public static String dntSdtYearMontMday (int year, int mont, int mday) {
1247: return String.format ("%04d-%02d-%02d", year, mont, mday);
1248: }
1249:
1250:
1251:
1252:
1253:
1254:
1255:
1256: public static String dntSdwCday (int cday) {
1257: return dntSdwDateWday (dntDateCday (cday), dntWdayCday (cday));
1258: }
1259:
1260:
1261:
1262: public static String dntSdwCmil (long cmil) {
1263: return dntSdwDateWday (dntDateCmil (cmil), dntWdayCmil (cmil));
1264: }
1265:
1266:
1267:
1268: public static String dntSdwCsec (long csec) {
1269: return dntSdwDateWday (dntDateCsec (csec), dntWdayCsec (csec));
1270: }
1271:
1272:
1273:
1274: public static String dntSdwDate (int date) {
1275:
1276: return dntSdwYearMontMdayWday (date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date));
1277: }
1278:
1279:
1280:
1281: public static String dntSdwDateWday (int date, int wday) {
1282:
1283: return dntSdwYearMontMdayWday (date >> 10, date >> 6 & 15, date & 63, wday);
1284: }
1285:
1286:
1287:
1288: public static String dntSdwDttm (long dttm) {
1289:
1290: return dntSdwDate ((int) (dttm >> 32));
1291: }
1292:
1293:
1294:
1295: public static String dntSdwDttmWday (long dttm, int wday) {
1296:
1297: return dntSdwDateWday ((int) (dttm >> 32), wday);
1298: }
1299:
1300:
1301:
1302: public static String dntSdwNow () {
1303: return dntSdwDate (dntDateNow ());
1304: }
1305:
1306:
1307:
1308: public static String dntSdwYearMontMday (int year, int mont, int mday) {
1309: return dntSdwYearMontMdayWday (year, mont, mday, dntWdayYearMontMday (year, mont, mday));
1310: }
1311:
1312:
1313:
1314: public static String dntSdwYearMontMdayWday (int year, int mont, int mday, int wday) {
1315: return String.format ("%04d-%02d-%02d (%s)", year, mont, mday, DNT_ENWDAY3_WDAY[wday]);
1316: }
1317:
1318:
1319:
1320:
1321:
1322:
1323:
1324: public static String dntSdttlCday (int cday) {
1325: return dntSdttlDateTime (dntDateCday (cday),
1326: 0);
1327: }
1328:
1329:
1330:
1331: public static String dntSdttlCdayDmil (int cday,
1332: int dmil) {
1333: return dntSdttlDateTime (dntDateCday (cday),
1334: dntTimeDmil (dmil));
1335: }
1336:
1337:
1338:
1339: public static String dntSdttlCdayDsec (int cday,
1340: int dsec) {
1341: return dntSdttlDateTime (dntDateCday (cday),
1342: dntTimeDsec (dsec));
1343: }
1344:
1345:
1346:
1347: public static String dntSdttlCdayHourMinuSeco (int cday,
1348: int hour, int minu, int seco) {
1349: int date = dntDateCday (cday);
1350:
1351:
1352: return dntSdttlYearMontMdayHourMinuSeco (date >> 10, date >> 6 & 15, date & 63,
1353: hour, minu, seco);
1354: }
1355:
1356:
1357:
1358: public static String dntSdttlCdayTime (int cday,
1359: int time) {
1360: return dntSdttlDateTime (dntDateCday (cday),
1361: time);
1362: }
1363:
1364:
1365:
1366: public static String dntSdttlCmil (long cmil) {
1367: return dntSdttlDttm (dntDttmCmil (cmil));
1368: }
1369:
1370:
1371:
1372: public static String dntSdttlCsec (long csec) {
1373: return dntSdttlDttm (dntDttmCsec (csec));
1374: }
1375:
1376:
1377:
1378: public static String dntSdttlDate (int date) {
1379: return dntSdttlDateTime (date,
1380: 0);
1381: }
1382:
1383:
1384:
1385: public static String dntSdttlDateDmil (int date,
1386: int dmil) {
1387: return dntSdttlDateTime (date,
1388: dntTimeDmil (dmil));
1389: }
1390:
1391:
1392:
1393: public static String dntSdttlDateDsec (int date,
1394: int dsec) {
1395: return dntSdttlDateTime (date,
1396: dntTimeDsec (dsec));
1397: }
1398:
1399:
1400:
1401: public static String dntSdttlDateHourMinuSeco (int date,
1402: int hour, int minu, int seco) {
1403:
1404:
1405: return dntSdttlYearMontMdayHourMinuSeco (date >> 10, date >> 6 & 15, date & 63,
1406: hour, minu, seco);
1407: }
1408:
1409:
1410:
1411: public static String dntSdttlDateTime (int date,
1412: int time) {
1413:
1414:
1415:
1416: return dntSdttlYearMontMdayHourMinuSeco (
1417: date >> 10, date >> 6 & 15, date & 63,
1418: time >> 22, time >> 16 & 63, time >> 10 & 63);
1419: }
1420:
1421:
1422:
1423: public static String dntSdttlDttm (long dttm) {
1424:
1425:
1426: int date = (int) (dttm >> 32);
1427: int time = (int) dttm;
1428:
1429:
1430:
1431: return dntSdttlYearMontMdayHourMinuSeco (
1432: date >> 10, date >> 6 & 15, date & 63,
1433: time >> 22, time >> 16 & 63, time >> 10 & 63);
1434: }
1435:
1436:
1437:
1438: public static String dntSdttlNow () {
1439: return dntSdttlDttm (dntDttmNow ());
1440: }
1441:
1442:
1443:
1444: public static String dntSdttlYearMontMday (int year, int mont, int mday) {
1445: return dntSdttlYearMontMdayHourMinuSeco (year, mont, mday,
1446: 0, 0, 0);
1447: }
1448:
1449:
1450:
1451: public static String dntSdttlYearMontMdayDmil (int year, int mont, int mday,
1452: int dmil) {
1453: int time = dntTimeDmil (dmil);
1454:
1455:
1456: return dntSdttlYearMontMdayHourMinuSeco (year, mont, mday,
1457: time >> 22, time >> 16 & 63, time >> 10 & 63);
1458: }
1459:
1460:
1461:
1462: public static String dntSdttlYearMontMdayDsec (int year, int mont, int mday,
1463: int dsec) {
1464: int time = dntTimeDsec (dsec);
1465:
1466:
1467: return dntSdttlYearMontMdayHourMinuSeco (year, mont, mday,
1468: time >> 22, time >> 16 & 63, time >> 10 & 63);
1469: }
1470:
1471:
1472:
1473: public static String dntSdttlYearMontMdayHourMinuSeco (int year, int mont, int mday,
1474: int hour, int minu, int seco) {
1475: return String.format ("%04d-%02d-%02d %02d:%02d:%02d", year, mont, mday, hour, minu, seco);
1476: }
1477:
1478:
1479:
1480: public static String dntSdttlYearMontMdayTime (int year, int mont, int mday,
1481: int time) {
1482:
1483:
1484: return dntSdttlYearMontMdayHourMinuSeco (year, mont, mday,
1485: time >> 22, time >> 16 & 63, time >> 10 & 63);
1486: }
1487:
1488:
1489:
1490:
1491:
1492:
1493:
1494: public static String dntSdttmCday (int cday) {
1495: return dntSdttmDateTime (dntDateCday (cday),
1496: 0);
1497: }
1498:
1499:
1500:
1501: public static String dntSdttmCdayDmil (int cday,
1502: int dmil) {
1503: return dntSdttmDateTime (dntDateCday (cday),
1504: dntTimeDmil (dmil));
1505: }
1506:
1507:
1508:
1509: public static String dntSdttmCdayDsec (int cday,
1510: int dsec) {
1511: return dntSdttmDateTime (dntDateCday (cday),
1512: dntTimeDsec (dsec));
1513: }
1514:
1515:
1516:
1517: public static String dntSdttmCdayHourMinuSeco (int cday,
1518: int hour, int minu, int seco) {
1519: int date = dntDateCday (cday);
1520:
1521:
1522: return dntSdttmYearMontMdayHourMinuSecoMill (date >> 10, date >> 6 & 15, date & 63,
1523: hour, minu, seco, 0);
1524: }
1525:
1526:
1527:
1528: public static String dntSdttmCdayHourMinuSecoMill (int cday,
1529: int hour, int minu, int seco, int mill) {
1530: int date = dntDateCday (cday);
1531:
1532:
1533: return dntSdttmYearMontMdayHourMinuSecoMill (date >> 10, date >> 6 & 15, date & 63,
1534: hour, minu, seco, mill);
1535: }
1536:
1537:
1538:
1539: public static String dntSdttmCdayTime (int cday,
1540: int time) {
1541: return dntSdttmDateTime (dntDateCday (cday),
1542: time);
1543: }
1544:
1545:
1546:
1547: public static String dntSdttmCmil (long cmil) {
1548: return dntSdttmDttm (dntDttmCmil (cmil));
1549: }
1550:
1551:
1552:
1553: public static String dntSdttmCsec (long csec) {
1554: return dntSdttmDttm (dntDttmCsec (csec));
1555: }
1556:
1557:
1558:
1559: public static String dntSdttmDate (int date) {
1560: return dntSdttmDateTime (date,
1561: 0);
1562: }
1563:
1564:
1565:
1566: public static String dntSdttmDateDmil (int date,
1567: int dmil) {
1568: return dntSdttmDateTime (date,
1569: dntTimeDmil (dmil));
1570: }
1571:
1572:
1573:
1574: public static String dntSdttmDateDsec (int date,
1575: int dsec) {
1576: return dntSdttmDateTime (date,
1577: dntTimeDsec (dsec));
1578: }
1579:
1580:
1581:
1582: public static String dntSdttmDateHourMinuSeco (int date,
1583: int hour, int minu, int seco) {
1584:
1585:
1586: return dntSdttmYearMontMdayHourMinuSecoMill (date >> 10, date >> 6 & 15, date & 63,
1587: hour, minu, seco, 0);
1588: }
1589:
1590:
1591:
1592: public static String dntSdttmDateHourMinuSecoMill (int date,
1593: int hour, int minu, int seco, int mill) {
1594:
1595:
1596: return dntSdttmYearMontMdayHourMinuSecoMill (date >> 10, date >> 6 & 15, date & 63,
1597: hour, minu, seco, mill);
1598: }
1599:
1600:
1601:
1602: public static String dntSdttmDateTime (int date,
1603: int time) {
1604:
1605:
1606:
1607: return dntSdttmYearMontMdayHourMinuSecoMill (
1608: date >> 10, date >> 6 & 15, date & 63,
1609: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
1610: }
1611:
1612:
1613:
1614: public static String dntSdttmDttm (long dttm) {
1615:
1616:
1617: int date = (int) (dttm >> 32);
1618: int time = (int) dttm;
1619:
1620:
1621:
1622: return dntSdttmYearMontMdayHourMinuSecoMill (
1623: date >> 10, date >> 6 & 15, date & 63,
1624: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
1625: }
1626:
1627:
1628:
1629: public static String dntSdttmNow () {
1630: return dntSdttmDttm (dntDttmNow ());
1631: }
1632:
1633:
1634:
1635: public static String dntSdttmYearMontMday (int year, int mont, int mday) {
1636: return dntSdttmYearMontMdayHourMinuSecoMill (year, mont, mday,
1637: 0, 0, 0, 0);
1638: }
1639:
1640:
1641:
1642: public static String dntSdttmYearMontMdayDmil (int year, int mont, int mday,
1643: int dmil) {
1644: int time = dntTimeDmil (dmil);
1645:
1646:
1647:
1648: return dntSdttmYearMontMdayHourMinuSecoMill (
1649: year, mont, mday,
1650: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
1651: }
1652:
1653:
1654:
1655: public static String dntSdttmYearMontMdayDsec (int year, int mont, int mday,
1656: int dsec) {
1657: int time = dntTimeDsec (dsec);
1658:
1659:
1660:
1661: return dntSdttmYearMontMdayHourMinuSecoMill (
1662: year, mont, mday,
1663: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
1664: }
1665:
1666:
1667:
1668: public static String dntSdttmYearMontMdayHourMinuSeco (int year, int mont, int mday,
1669: int hour, int minu, int seco) {
1670: return dntSdttmYearMontMdayHourMinuSecoMill (year, mont, mday,
1671: hour, minu, seco, 0);
1672: }
1673:
1674:
1675:
1676: public static String dntSdttmYearMontMdayHourMinuSecoMill (int year, int mont, int mday,
1677: int hour, int minu, int seco, int mill) {
1678: return String.format ("%04d-%02d-%02d %02d:%02d:%02d.%03d", year, mont, mday, hour, minu, seco, mill);
1679: }
1680:
1681:
1682:
1683: public static String dntSdttmYearMontMdayTime (int year, int mont, int mday,
1684: int time) {
1685:
1686:
1687:
1688: return dntSdttmYearMontMdayHourMinuSecoMill (
1689: year, mont, mday,
1690: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
1691: }
1692:
1693:
1694:
1695:
1696:
1697:
1698:
1699: public static String dntSdwtlCday (int cday) {
1700: return dntSdwtlDttmWday (dntDttmCday (cday), dntWdayCday (cday));
1701: }
1702:
1703:
1704:
1705: public static String dntSdwtlCdayDmil (int cday, int dmil) {
1706: return dntSdwtlDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
1707: dntTimeDmil (dmil));
1708: }
1709:
1710:
1711:
1712: public static String dntSdwtlCdayDsec (int cday,
1713: int dsec) {
1714: return dntSdwtlDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
1715: dntTimeDsec (dsec));
1716: }
1717:
1718:
1719:
1720: public static String dntSdwtlCdayHourMinuSeco (int cday,
1721: int hour, int minu, int seco) {
1722: int date = dntDateCday (cday);
1723:
1724:
1725:
1726: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1727: date >> 10, date >> 6 & 15, date & 63, dntWdayCday (cday),
1728: hour, minu, seco);
1729: }
1730:
1731:
1732:
1733: public static String dntSdwtlCdayTime (int cday,
1734: int time) {
1735: return dntSdwtlDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
1736: time);
1737: }
1738:
1739:
1740:
1741: public static String dntSdwtlCmil (long cmil) {
1742: return dntSdwtlDttmWday (dntDttmCmil (cmil), dntWdayCmil (cmil));
1743: }
1744:
1745:
1746:
1747: public static String dntSdwtlCsec (long csec) {
1748: return dntSdwtlDttmWday (dntDttmCsec (csec), dntWdayCsec (csec));
1749: }
1750:
1751:
1752:
1753: public static String dntSdwtlDate (int date) {
1754: return dntSdwtlDateWdayTime (date, dntWdayDate (date),
1755: 0);
1756: }
1757:
1758:
1759:
1760: public static String dntSdwtlDateDmil (int date, int dmil) {
1761: return dntSdwtlDateWdayTime (date, dntWdayDate (date),
1762: dntTimeDmil (dmil));
1763: }
1764:
1765:
1766:
1767: public static String dntSdwtlDateDsec (int date, int dsec) {
1768: return dntSdwtlDateWdayTime (date, dntWdayDate (date),
1769: dntTimeDsec (dsec));
1770: }
1771:
1772:
1773:
1774: public static String dntSdwtlDateHourMinuSeco (int date,
1775: int hour, int minu, int seco) {
1776:
1777:
1778:
1779: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1780: date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date),
1781: hour, minu, seco);
1782: }
1783:
1784:
1785:
1786: public static String dntSdwtlDateTime (int date,
1787: int time) {
1788: return dntSdwtlDateWdayTime (date, dntWdayDate (date),
1789: time);
1790: }
1791:
1792:
1793:
1794: public static String dntSdwtlDateWday (int date, int wday) {
1795: return dntSdwtlDateWdayTime (date, wday,
1796: 0);
1797: }
1798:
1799:
1800:
1801: public static String dntSdwtlDateWdayDmil (int date, int wday,
1802: int dmil) {
1803: int time = dntTimeDmil (dmil);
1804:
1805:
1806:
1807: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1808: date >> 10, date >> 6 & 15, date & 63, wday,
1809: time >> 22, time >> 16 & 63, time >> 10 & 63);
1810: }
1811:
1812:
1813:
1814: public static String dntSdwtlDateWdayDsec (int date, int wday,
1815: int dsec) {
1816: int time = dntTimeDsec (dsec);
1817:
1818:
1819:
1820: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1821: date >> 10, date >> 6 & 15, date & 63, wday,
1822: time >> 22, time >> 16 & 63, time >> 10 & 63);
1823: }
1824:
1825:
1826:
1827: public static String dntSdwtlDateWdayHourMinuSeco (int date, int wday,
1828: int hour, int minu, int seco) {
1829:
1830:
1831:
1832: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1833: date >> 10, date >> 6 & 15, date & 63, wday,
1834: hour, minu, seco);
1835: }
1836:
1837:
1838:
1839: public static String dntSdwtlDateWdayTime (int date, int wday,
1840: int time) {
1841:
1842:
1843:
1844: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1845: date >> 10, date >> 6 & 15, date & 63, wday,
1846: time >> 22, time >> 16 & 63, time >> 10 & 63);
1847: }
1848:
1849:
1850:
1851: public static String dntSdwtlDttm (long dttm) {
1852:
1853: int date = (int) (dttm >> 32);
1854:
1855: int time = (int) dttm;
1856:
1857:
1858:
1859: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1860: date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date),
1861: time >> 22, time >> 16 & 63, time >> 10 & 63);
1862: }
1863:
1864:
1865:
1866: public static String dntSdwtlDttmWday (long dttm, int wday) {
1867:
1868: int date = (int) (dttm >> 32);
1869:
1870: int time = (int) dttm;
1871:
1872:
1873:
1874: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1875: date >> 10, date >> 6 & 15, date & 63, wday,
1876: time >> 22, time >> 16 & 63, time >> 10 & 63);
1877: }
1878:
1879:
1880:
1881: public static String dntSdwtlNow () {
1882: return dntSdwtlCmil (dntCmilNow ());
1883: }
1884:
1885:
1886:
1887: public static String dntSdwtlYearMontMday (int year, int mont, int mday) {
1888: return dntSdwtlYearMontMdayWdayHourMinuSeco (year, mont, mday, dntWdayYearMontMday (year, mont, mday),
1889: 0, 0, 0);
1890: }
1891:
1892:
1893:
1894: public static String dntSdwtlYearMontMdayDmil (int year, int mont, int mday,
1895: int dmil) {
1896: int time = dntTimeDmil (dmil);
1897:
1898:
1899:
1900: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1901: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
1902: time >> 22, time >> 16 & 63, time >> 10 & 63);
1903: }
1904:
1905:
1906:
1907: public static String dntSdwtlYearMontMdayDsec (int year, int mont, int mday,
1908: int dsec) {
1909: int time = dntTimeDsec (dsec);
1910:
1911:
1912:
1913: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1914: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
1915: time >> 22, time >> 16 & 63, time >> 10 & 63);
1916: }
1917:
1918:
1919:
1920: public static String dntSdwtlYearMontMdayHourMinuSeco (int year, int mont, int mday,
1921: int hour, int minu, int seco) {
1922: return dntSdwtlYearMontMdayWdayHourMinuSeco (year, mont, mday, dntWdayYearMontMday (year, mont, mday),
1923: hour, minu, seco);
1924: }
1925:
1926:
1927:
1928: public static String dntSdwtlYearMontMdayTime (int year, int mont, int mday,
1929: int time) {
1930:
1931:
1932:
1933: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1934: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
1935: time >> 22, time >> 16 & 63, time >> 10 & 63);
1936: }
1937:
1938:
1939:
1940: public static String dntSdwtlYearMontMdayWday (int year, int mont, int mday, int wday) {
1941: return dntSdwtlYearMontMdayWdayHourMinuSeco (year, mont, mday, wday,
1942: 0, 0, 0);
1943: }
1944:
1945:
1946:
1947: public static String dntSdwtlYearMontMdayWdayDmil (int year, int mont, int mday, int wday,
1948: int dmil) {
1949: int time = dntTimeDmil (dmil);
1950:
1951:
1952:
1953: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1954: year, mont, mday, wday,
1955: time >> 22, time >> 16 & 63, time >> 10 & 63);
1956: }
1957:
1958:
1959:
1960: public static String dntSdwtlYearMontMdayWdayDsec (int year, int mont, int mday, int wday,
1961: int dsec) {
1962: int time = dntTimeDsec (dsec);
1963:
1964:
1965:
1966: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1967: year, mont, mday, wday,
1968: time >> 22, time >> 16 & 63, time >> 10 & 63);
1969: }
1970:
1971:
1972:
1973: public static String dntSdwtlYearMontMdayWdayHourMinuSeco (int year, int mont, int mday, int wday,
1974: int hour, int minu, int seco) {
1975: return String.format ("%04d-%02d-%02d (%s) %02d:%02d:%02d",
1976: year, mont, mday, DNT_ENWDAY3_WDAY[wday],
1977: hour, minu, seco);
1978: }
1979:
1980:
1981:
1982: public static String dntSdwtlYearMontMdayWdayTime (int year, int mont, int mday, int wday,
1983: int time) {
1984:
1985:
1986:
1987: return dntSdwtlYearMontMdayWdayHourMinuSeco (
1988: year, mont, mday, wday,
1989: time >> 22, time >> 16 & 63, time >> 10 & 63);
1990: }
1991:
1992:
1993:
1994:
1995:
1996:
1997:
1998: public static String dntSdwtmCday (int cday) {
1999: return dntSdwtmDttmWday (dntDttmCday (cday), dntWdayCday (cday));
2000: }
2001:
2002:
2003:
2004: public static String dntSdwtmCdayDmil (int cday, int dmil) {
2005: return dntSdwtmDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
2006: dntTimeDmil (dmil));
2007: }
2008:
2009:
2010:
2011: public static String dntSdwtmCdayDsec (int cday,
2012: int dsec) {
2013: return dntSdwtmDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
2014: dntTimeDsec (dsec));
2015: }
2016:
2017:
2018:
2019: public static String dntSdwtmCdayHourMinuSeco (int cday,
2020: int hour, int minu, int seco) {
2021: int date = dntDateCday (cday);
2022:
2023:
2024:
2025: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2026: date >> 10, date >> 6 & 15, date & 63, dntWdayCday (cday),
2027: hour, minu, seco, 0);
2028: }
2029:
2030:
2031:
2032: public static String dntSdwtmCdayHourMinuSecoMill (int cday,
2033: int hour, int minu, int seco, int mill) {
2034: int date = dntDateCday (cday);
2035:
2036:
2037:
2038: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2039: date >> 10, date >> 6 & 15, date & 63, dntWdayCday (cday),
2040: hour, minu, seco, mill);
2041: }
2042:
2043:
2044:
2045: public static String dntSdwtmCdayTime (int cday,
2046: int time) {
2047: return dntSdwtmDateWdayTime (dntDateCday (cday), dntWdayCday (cday),
2048: time);
2049: }
2050:
2051:
2052:
2053: public static String dntSdwtmCmil (long cmil) {
2054: return dntSdwtmDttmWday (dntDttmCmil (cmil), dntWdayCmil (cmil));
2055: }
2056:
2057:
2058:
2059: public static String dntSdwtmCsec (long csec) {
2060: return dntSdwtmDttmWday (dntDttmCsec (csec), dntWdayCsec (csec));
2061: }
2062:
2063:
2064:
2065: public static String dntSdwtmDate (int date) {
2066: return dntSdwtmDateWdayTime (date, dntWdayDate (date),
2067: 0);
2068: }
2069:
2070:
2071:
2072: public static String dntSdwtmDateDmil (int date, int dmil) {
2073: return dntSdwtmDateWdayTime (date, dntWdayDate (date),
2074: dntTimeDmil (dmil));
2075: }
2076:
2077:
2078:
2079: public static String dntSdwtmDateDsec (int date, int dsec) {
2080: return dntSdwtmDateWdayTime (date, dntWdayDate (date),
2081: dntTimeDsec (dsec));
2082: }
2083:
2084:
2085:
2086: public static String dntSdwtmDateHourMinuSeco (int date,
2087: int hour, int minu, int seco) {
2088:
2089:
2090:
2091: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2092: date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date),
2093: hour, minu, seco, 0);
2094: }
2095:
2096:
2097:
2098: public static String dntSdwtmDateHourMinuSecoMill (int date,
2099: int hour, int minu, int seco, int mill) {
2100:
2101:
2102:
2103: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2104: date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date),
2105: hour, minu, seco, mill);
2106: }
2107:
2108:
2109:
2110: public static String dntSdwtmDateTime (int date,
2111: int time) {
2112: return dntSdwtmDateWdayTime (date, dntWdayDate (date),
2113: time);
2114: }
2115:
2116:
2117:
2118: public static String dntSdwtmDateWday (int date, int wday) {
2119: return dntSdwtmDateWdayTime (date, wday,
2120: 0);
2121: }
2122:
2123:
2124:
2125: public static String dntSdwtmDateWdayDmil (int date, int wday,
2126: int dmil) {
2127: int time = dntTimeDmil (dmil);
2128:
2129:
2130:
2131: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2132: date >> 10, date >> 6 & 15, date & 63, wday,
2133: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2134: }
2135:
2136:
2137:
2138: public static String dntSdwtmDateWdayDsec (int date, int wday,
2139: int dsec) {
2140: int time = dntTimeDsec (dsec);
2141:
2142:
2143:
2144: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2145: date >> 10, date >> 6 & 15, date & 63, wday,
2146: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2147: }
2148:
2149:
2150:
2151: public static String dntSdwtmDateWdayHourMinuSeco (int date, int wday,
2152: int hour, int minu, int seco) {
2153:
2154:
2155:
2156: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2157: date >> 10, date >> 6 & 15, date & 63, wday,
2158: hour, minu, seco, 0);
2159: }
2160:
2161:
2162:
2163: public static String dntSdwtmDateWdayHourMinuSecoMill (int date, int wday,
2164: int hour, int minu, int seco, int mill) {
2165:
2166:
2167:
2168: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2169: date >> 10, date >> 6 & 15, date & 63, wday,
2170: hour, minu, seco, mill);
2171: }
2172:
2173:
2174:
2175: public static String dntSdwtmDateWdayTime (int date, int wday,
2176: int time) {
2177:
2178:
2179:
2180: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2181: date >> 10, date >> 6 & 15, date & 63, wday,
2182: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2183: }
2184:
2185:
2186:
2187: public static String dntSdwtmDttm (long dttm) {
2188:
2189: int date = (int) (dttm >> 32);
2190:
2191: int time = (int) dttm;
2192:
2193:
2194:
2195: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2196: date >> 10, date >> 6 & 15, date & 63, dntWdayDate (date),
2197: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2198: }
2199:
2200:
2201:
2202: public static String dntSdwtmDttmWday (long dttm, int wday) {
2203:
2204: int date = (int) (dttm >> 32);
2205:
2206: int time = (int) dttm;
2207:
2208:
2209:
2210: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2211: date >> 10, date >> 6 & 15, date & 63, wday,
2212: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2213: }
2214:
2215:
2216:
2217: public static String dntSdwtmNow () {
2218: return dntSdwtmCmil (dntCmilNow ());
2219: }
2220:
2221:
2222:
2223: public static String dntSdwtmYearMontMday (int year, int mont, int mday) {
2224: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2225: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2226: 0, 0, 0, 0);
2227: }
2228:
2229:
2230:
2231: public static String dntSdwtmYearMontMdayDmil (int year, int mont, int mday,
2232: int dmil) {
2233: int time = dntTimeDmil (dmil);
2234:
2235:
2236:
2237: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2238: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2239: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2240: }
2241:
2242:
2243:
2244: public static String dntSdwtmYearMontMdayDsec (int year, int mont, int mday,
2245: int dsec) {
2246: int time = dntTimeDsec (dsec);
2247:
2248:
2249:
2250: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2251: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2252: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2253: }
2254:
2255:
2256:
2257: public static String dntSdwtmYearMontMdayHourMinuSeco (int year, int mont, int mday,
2258: int hour, int minu, int seco) {
2259: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2260: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2261: hour, minu, seco, 0);
2262: }
2263:
2264:
2265:
2266: public static String dntSdwtmYearMontMdayHourMinuSecoMill (int year, int mont, int mday,
2267: int hour, int minu, int seco, int mill) {
2268: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2269: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2270: hour, minu, seco, mill);
2271: }
2272:
2273:
2274:
2275: public static String dntSdwtmYearMontMdayTime (int year, int mont, int mday,
2276: int time) {
2277:
2278:
2279:
2280: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2281: year, mont, mday, dntWdayYearMontMday (year, mont, mday),
2282: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2283: }
2284:
2285:
2286:
2287: public static String dntSdwtmYearMontMdayWday (int year, int mont, int mday, int wday) {
2288: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2289: year, mont, mday, wday,
2290: 0, 0, 0, 0);
2291: }
2292:
2293:
2294:
2295: public static String dntSdwtmYearMontMdayWdayDmil (int year, int mont, int mday, int wday,
2296: int dmil) {
2297: int time = dntTimeDmil (dmil);
2298:
2299:
2300:
2301: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2302: year, mont, mday, wday,
2303: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2304: }
2305:
2306:
2307:
2308: public static String dntSdwtmYearMontMdayWdayDsec (int year, int mont, int mday, int wday,
2309: int dsec) {
2310: int time = dntTimeDsec (dsec);
2311:
2312:
2313:
2314: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2315: year, mont, mday, wday,
2316: time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2317: }
2318:
2319:
2320:
2321: public static String dntSdwtmYearMontMdayWdayHourMinuSeco (int year, int mont, int mday, int wday,
2322: int hour, int minu, int seco) {
2323: return dntSdwtmYearMontMdayWdayHourMinuSecoMill (
2324: year, mont, mday, wday,
2325: hour, minu, seco, 0);
2326: }
2327:
2328:
2329:
2330: public static String dntSdwtmYearMontMdayWdayHourMinuSecoMill (int year, int mont, int mday, int wday,
2331: int hour, int minu, int seco, int mill) {
2332: return String.format ("%04d-%02d-%02d (%s) %02d:%02d:%02d.%03d",
2333: year, mont, mday, DNT_ENWDAY3_WDAY[wday],
2334: hour, minu, seco, mill);
2335: }
2336:
2337:
2338:
2339: public static String dntSdwtmYearMontMdayWdayTime (int year, int mont, int mday, int wday,
2340: int time) {
2341:
2342:
2343:
2344: return dntSdwtmYearMontMdayWdayHourMinuSeco (
2345: year, mont, mday, wday,
2346: time >> 22, time >> 16 & 63, time >> 10 & 63);
2347: }
2348:
2349:
2350:
2351:
2352:
2353:
2354:
2355: public static int dntSecoCmil (long cmil) {
2356:
2357:
2358:
2359: return (int) dntFrem (cmil, 60000L) * 67109 >>> 26;
2360: }
2361:
2362:
2363:
2364: public static int dntSecoCsec (long csec) {
2365: return (int) dntFrem (csec, 60L);
2366: }
2367:
2368:
2369:
2370: public static int dntSecoDmil (int dmil) {
2371:
2372:
2373:
2374: return dntFrem (dmil, 60000) * 67109 >>> 26;
2375: }
2376:
2377:
2378:
2379: public static int dntSecoDsec (int dsec) {
2380: return dntFrem (dsec, 60);
2381: }
2382:
2383:
2384:
2385: public static int dntSecoDttm (long dttm) {
2386: return (int) dttm >> 10 & 63;
2387: }
2388:
2389:
2390:
2391: public static int dntSecoNow () {
2392:
2393:
2394:
2395:
2396: return (int) dntFrem (System.currentTimeMillis (), 60000L) * 67109 >>> 26;
2397: }
2398:
2399:
2400:
2401: public static int dntSecoTime (int time) {
2402: return time >> 10 & 63;
2403: }
2404:
2405:
2406:
2407:
2408:
2409:
2410:
2411: public static String dntStlCmil (int cmil) {
2412: return dntStlTime (dntTimeCmil (cmil));
2413: }
2414:
2415:
2416:
2417: public static String dntStlCsec (int csec) {
2418: return dntStlTime (dntTimeCsec (csec));
2419: }
2420:
2421:
2422:
2423: public static String dntStlDmil (int dmil) {
2424: return dntStlTime (dntTimeDmil (dmil));
2425: }
2426:
2427:
2428:
2429: public static String dntStlDsec (int dsec) {
2430: return dntStlTime (dntTimeDsec (dsec));
2431: }
2432:
2433:
2434:
2435: public static String dntStlDttm (long dttm) {
2436:
2437: return dntStlTime ((int) dttm);
2438: }
2439:
2440:
2441:
2442: public static String dntStlHourMinuSeco (int hour, int minu, int seco) {
2443: return String.format ("%02d:%02d:%02d", hour, minu, seco);
2444: }
2445:
2446:
2447:
2448: public static String dntStlNow () {
2449: return dntStlTime (dntTimeNow ());
2450: }
2451:
2452:
2453:
2454: public static String dntStlTime (int time) {
2455:
2456: return dntStlHourMinuSeco (time >> 22, time >> 16 & 63, time >> 10 & 63);
2457: }
2458:
2459:
2460:
2461:
2462:
2463:
2464:
2465: public static String dntStmCmil (int cmil) {
2466: return dntStmTime (dntTimeCmil (cmil));
2467: }
2468:
2469:
2470:
2471: public static String dntStmCsec (int csec) {
2472: return dntStmTime (dntTimeCsec (csec));
2473: }
2474:
2475:
2476:
2477: public static String dntStmDmil (int dmil) {
2478: return dntStmTime (dntTimeDmil (dmil));
2479: }
2480:
2481:
2482:
2483: public static String dntStmDsec (int dsec) {
2484: return dntStmTime (dntTimeDsec (dsec));
2485: }
2486:
2487:
2488:
2489: public static String dntStmDttm (long dttm) {
2490:
2491: return dntStmTime ((int) dttm);
2492: }
2493:
2494:
2495:
2496: public static String dntStmHourMinuSeco (int hour, int minu, int seco) {
2497: return dntStmHourMinuSecoMill (hour, minu, seco, 0);
2498: }
2499:
2500:
2501:
2502: public static String dntStmHourMinuSecoMill (int hour, int minu, int seco, int mill) {
2503: return String.format ("%02d:%02d:%02d.%03d", hour, minu, seco, mill);
2504: }
2505:
2506:
2507:
2508: public static String dntStmNow () {
2509: return dntStmTime (dntTimeNow ());
2510: }
2511:
2512:
2513:
2514: public static String dntStmTime (int time) {
2515:
2516: return dntStmHourMinuSecoMill (time >> 22, time >> 16 & 63, time >> 10 & 63, time & 1023);
2517: }
2518:
2519:
2520:
2521:
2522:
2523:
2524:
2525: public static int dntTimeCmil (long cmil) {
2526:
2527: return dntTimeDmil ((int) dntFrem (cmil, 86400000L));
2528: }
2529:
2530:
2531:
2532: public static int dntTimeCsec (long csec) {
2533:
2534: return dntTimeDsec ((int) dntFrem (csec, 86400L));
2535: }
2536:
2537:
2538:
2539: public static int dntTimeDmil (int dmil) {
2540: int hour = dntFdiv (dmil, 3600000);
2541: dmil -= hour * 3600000;
2542: int minu = dntFdiv (dmil, 60000);
2543: dmil -= minu * 60000;
2544: int seco = dntFdiv (dmil, 1000);
2545: dmil -= seco * 1000;
2546: return dntTimeHourMinuSecoMill (hour, minu, seco, dmil);
2547: }
2548:
2549:
2550:
2551: public static int dntTimeDsec (int dsec) {
2552: int hour = dntFdiv (dsec, 3600);
2553: dsec -= hour * 3600;
2554: int minu = dntFdiv (dsec, 60);
2555: dsec -= minu * 60;
2556: return dntTimeHourMinuSeco (hour, minu, dsec);
2557: }
2558:
2559:
2560:
2561: public static int dntTimeDttm (long dttm) {
2562: return (int) dttm;
2563: }
2564:
2565:
2566:
2567: public static int dntTimeHourMinuSeco (int hour, int minu, int seco) {
2568: return hour << 22 | (minu & 63) << 16 | (seco & 63) << 10;
2569: }
2570:
2571:
2572:
2573: public static int dntTimeHourMinuSecoMill (int hour, int minu, int seco, int mill) {
2574: return hour << 22 | (minu & 63) << 16 | (seco & 63) << 10 | mill & 1023;
2575: }
2576:
2577:
2578:
2579: public static int dntTimeNow () {
2580:
2581: return dntTimeDmil ((int) dntFrem (System.currentTimeMillis (), 86400000L));
2582: }
2583:
2584:
2585:
2586:
2587:
2588:
2589:
2590: public static int dntWdayCday (int cday) {
2591: return dntFrem (cday + 4, 7);
2592: }
2593:
2594:
2595:
2596: public static int dntWdayCmil (long cmil) {
2597:
2598: return dntFrem ((int) dntFdiv (cmil, 86400000L) + 4, 7);
2599: }
2600:
2601:
2602:
2603: public static int dntWdayCsec (long csec) {
2604:
2605: return dntFrem ((int) dntFdiv (csec, 86400L) + 4, 7);
2606: }
2607:
2608:
2609:
2610: public static int dntWdayDate (int date) {
2611:
2612: return dntFrem (dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) + 4, 7);
2613: }
2614:
2615:
2616:
2617: public static int dntWdayDttm (long dttm) {
2618:
2619: int date = (int) (dttm >> 32);
2620:
2621: return dntFrem (dntCdayYearMontMday (date >> 10, date >> 6 & 15, date & 63) + 4, 7);
2622: }
2623:
2624:
2625:
2626: public static int dntWdayNow () {
2627:
2628: return dntFrem ((int) dntFdiv (System.currentTimeMillis (), 86400000L) + 4, 7);
2629: }
2630:
2631:
2632:
2633: public static int dntWdayYearMontMday (int year, int mont, int mday) {
2634: return dntFrem (dntCdayYearMontMday (year, mont, mday) + 4, 7);
2635: }
2636:
2637:
2638:
2639:
2640:
2641:
2642:
2643: public static int dntYearCday (int cday) {
2644:
2645: return dntDateCday (cday) >> 10;
2646: }
2647:
2648:
2649:
2650: public static int dntYearCmil (long cmil) {
2651:
2652: return dntDateCday ((int) dntFdiv (cmil, 86400000L)) >> 10;
2653: }
2654:
2655:
2656:
2657: public static int dntYearCsec (long csec) {
2658:
2659: return dntDateCday ((int) dntFdiv (csec, 86400L)) >> 10;
2660: }
2661:
2662:
2663:
2664: public static int dntYearDate (int date) {
2665: return date >> 10;
2666: }
2667:
2668:
2669:
2670: public static int dntYearDttm (long dttm) {
2671: return (int) (dttm >> 42);
2672: }
2673:
2674:
2675:
2676: public static int dntYearNow () {
2677:
2678: return dntDateCday ((int) dntFdiv (System.currentTimeMillis (), 86400000L)) >> 10;
2679: }
2680:
2681:
2682:
2683:
2684:
2685:
2686:
2687:
2688:
2689:
2690:
2691:
2692:
2693:
2694:
2695:
2696:
2697:
2698:
2699:
2700:
2701:
2702:
2703:
2704:
2705:
2706:
2707:
2708:
2709:
2710:
2711:
2712:
2713:
2714:
2715:
2716:
2717:
2718:
2719:
2720:
2721:
2722:
2723:
2724:
2725:
2726:
2727:
2728:
2729:
2730:
2731:
2732:
2733:
2734:
2735:
2736:
2737:
2738:
2739:
2740:
2741:
2742: public static String dntJaholiDttm (long dttm) {
2743:
2744: int date = (int) (dttm >> 32);
2745:
2746: return dntJaholiYearMontMday (date >> 10, date >> 6 & 15, date & 63);
2747: }
2748:
2749:
2750:
2751: public static String dntJaholidate (int date) {
2752:
2753: return dntJaholiYearMontMday (date >> 10, date >> 6 & 15, date & 63);
2754: }
2755:
2756:
2757:
2758: public static String dntJaholiYearMontMday (int year, int mont, int mday) {
2759:
2760: int wday = dntWdayYearMontMday (year, mont, mday);
2761: int wnum = dntFdiv (mday + 6, 7);
2762: int mdayVernal = ((year & 3) == 0 ? year <= 1956 ? 21 : year <= 2088 ? 20 : 19 :
2763: (year & 3) == 1 ? year <= 1989 ? 21 : 20 :
2764: (year & 3) == 2 ? year <= 2022 ? 21 : 20 :
2765: year <= 1923 ? 22 : year <= 2055 ? 21 : 20);
2766: int mdayAutumnal = ((year & 3) == 0 ? year <= 2008 ? 23 : 22 :
2767: (year & 3) == 1 ? year <= 1917 ? 24 : year <= 2041 ? 23 : 22 :
2768: (year & 3) == 2 ? year <= 1946 ? 24 : year <= 2074 ? 23 : 22 :
2769: year <= 1979 ? 24 : 23);
2770: return (mont == 1 ?
2771: 1949 <= year && mday == 1 ? "元日" :
2772: 1974 <= year && mday == 2 && wday == 1 ? "振替休日" :
2773: 2000 <= year && wnum == 2 && wday == 1 ? "成人の日" :
2774: 1949 <= year && year <= 1999 && mday == 15 ? "成人の日" :
2775: 1974 <= year && year <= 1999 && mday == 16 && wday == 1 ? "振替休日" : null :
2776: mont == 2 ?
2777: year == 1989 && mday == 24 ? "昭和天皇の大喪の礼" :
2778: 1967 <= year && mday == 11 ? "建国記念の日" :
2779: 1974 <= year && mday == 12 && wday == 1 ? "振替休日" : null :
2780: mont == 3 ?
2781: 1949 <= year && mday == mdayVernal ? "春分の日" :
2782: 1974 <= year && mday == mdayVernal + 1 && wday == 1 ? "振替休日" : null :
2783: mont == 4 ?
2784: year == 1959 && mday == 10 ? "皇太子明仁親王の結婚の儀" :
2785: 1949 <= year && year <= 1988 && mday == 29 ? "天皇誕生日" :
2786: 1989 <= year && year <= 2006 && mday == 29 ? "みどりの日" :
2787: 2007 <= year && mday == 29 ? "昭和の日" :
2788: 1973 <= year && mday == 30 && wday == 1 ? "振替休日" : null :
2789: mont == 5 ?
2790: 1949 <= year && mday == 3 ? "憲法記念日" :
2791: 1973 <= year && year <= 1987 && mday == 4 && wday == 1 ? "振替休日" :
2792: 1988 <= year && year <= 2006 && mday == 4 ? "国民の休日" :
2793: 2007 <= year && mday == 4 ? "みどりの日" :
2794: 1949 <= year && mday == 5 ? "こどもの日" :
2795: 1973 <= year && year <= 2006 && mday == 6 && wday == 1 ? "振替休日" :
2796: 2007 <= year && mday == 6 && (wday == 1 || wday == 2 || wday == 3) ? "振替休日" : null :
2797: mont == 6 ?
2798: year == 1993 && mday == 9 ? "皇太子徳仁親王の結婚の儀" : null :
2799: mont == 7 ?
2800: 2003 <= year && wnum == 3 && wday == 1 ? "海の日" :
2801: 1996 <= year && year <= 2002 && mday == 20 ? "海の日" :
2802: 1996 <= year && year <= 2002 && mday == 21 && wday == 1 ? "振替休日" : null :
2803: mont == 8 ?
2804: 2016 <= year && mday == 11 ? "山の日" : null :
2805: mont == 9 ?
2806: 1966 <= year && year <= 2002 && mday == 15 ? "敬老の日" :
2807: 2003 <= year && wnum == 3 && wday == 1 ? "敬老の日" :
2808: 1973 <= year && year <= 2002 && mday == 16 && wday == 1 ? "振替休日" :
2809: 2003 <= year && dntFdiv (mday + 5, 7) == 3 && wday == 2 && mday == mdayAutumnal - 1 ? "国民の休日" :
2810: 1948<= year && mday == mdayAutumnal ? "秋分の日" :
2811: 1973 <= year && mday == mdayAutumnal + 1 && wday == 1 ? "振替休日" : null :
2812: mont == 10 ?
2813: 1966 <= year && year <= 1999 && mday == 10 ? "体育の日" :
2814: 2000 <= year && wnum == 2 && wday == 1 ? "体育の日" :
2815: 1973 <= year && year <= 1999 && mday == 11 && wday == 1 ? "振替休日" : null :
2816: mont == 11 ?
2817: year == 1990 && mday == 12 ? "即位礼正殿の儀" :
2818: 1948 <= year && mday == 3 ? "文化の日" :
2819: 1973 <= year && mday == 4 && wday == 1 ? "振替休日" :
2820: 1948 <= year && mday == 23 ? "勤労感謝の日" :
2821: 1973 <= year && mday == 24 && wday == 1 ? "振替休日" : null :
2822: mont == 12 ?
2823: 1989 <= year && mday == 23 ? "天皇誕生日" :
2824: 1989 <= year && mday == 24 && wday == 1 ? "振替休日" : null :
2825: null);
2826: }
2827:
2828:
2829: }
2830:
2831:
2832: