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