示例#1
0
        /// <summary>
        /// 获取增加指定的数值后的干支实例
        /// </summary>
        /// <param name="i">增加的数值</param>
        /// <returns>干支</returns>
        public GanZhi Inc(int i)
        {
            TianGan t = _tg.Inc(i);
            DiZhi   d = _dz.Inc(i);

            return(new GanZhi(t, d));
        }
示例#2
0
        /// <summary>
        /// 取某天的日支
        /// </summary>
        /// <param name="dt">日期</param>
        /// <returns></returns>
        private DiZhi GetDayZhi(System.DateTime dt)
        {
            System.DateTime dt1 = new System.DateTime(2000, 2, 5, 12, 0, 0, 0);////以2000.2.5为基准
            System.DateTime dt2 = new System.DateTime(dt.Year, dt.Month, dt.Day, 12, 0, 0, 0);
            int             n   = (dt2 - dt1).Days;
            DiZhi           dz  = new DiZhi(DiZhiTypes.Si);

            return(dz.Inc(n));
        }
示例#3
0
文件: HFDate.cs 项目: Loong-Lee/VSDT
        private DiZhi GetDayZhi(DateTime dt)
        {
            DateTime time  = new DateTime(0x7d0, 2, 5, 12, 0, 0, 0);
            DateTime time2 = new DateTime(dt.Year, dt.Month, dt.Day, 12, 0, 0, 0);
            TimeSpan span  = (TimeSpan)(time2 - time);
            int      days  = span.Days;
            DiZhi    zhi   = new DiZhi(DiZhiTypes.Si);

            return(zhi.Inc(days));
        }
示例#4
0
文件: HFDate.cs 项目: Loong-Lee/VSDT
        private DiZhi GetYearDiZhi(int y)
        {
            int   i   = y - 0x7d0;
            DiZhi zhi = new DiZhi(DiZhiTypes.Chen);

            if (i == 0)
            {
                return(zhi);
            }
            return(zhi.Inc(i));
        }
示例#5
0
        /// <summary>
        /// 取指定公历年的地支
        /// </summary>
        /// <param name="y">年份</param>
        /// <returns>地支</returns>
        private DiZhi GetYearDiZhi(int y)
        {
            int   i  = y - 2000;//以2000年为基准
            DiZhi dz = new DiZhi(DiZhiTypes.Chen);

            if (i == 0)
            {
                return(dz);
            }
            else
            {
                return(dz.Inc(i));
            }
        }
示例#6
0
文件: HFDate.cs 项目: sunpander/VSDT
 private DiZhi GetYearDiZhi(int y)
 {
     int i = y - 0x7d0;
     DiZhi zhi = new DiZhi(DiZhiTypes.Chen);
     if (i == 0)
     {
         return zhi;
     }
     return zhi.Inc(i);
 }
示例#7
0
文件: HFDate.cs 项目: sunpander/VSDT
 private DiZhi GetDayZhi(DateTime dt)
 {
     DateTime time = new DateTime(0x7d0, 2, 5, 12, 0, 0, 0);
     DateTime time2 = new DateTime(dt.Year, dt.Month, dt.Day, 12, 0, 0, 0);
     TimeSpan span = (TimeSpan) (time2 - time);
     int days = span.Days;
     DiZhi zhi = new DiZhi(DiZhiTypes.Si);
     return zhi.Inc(days);
 }