Beispiel #1
0
        /// <summary>
        /// Double转换成时间
        /// </summary>
        /// <param name="num"></param>
        /// <returns></returns>
        public static DateTime ConvertNumToDate(double num)
        {
            int year        = 0;
            int month       = 0;
            int day         = 0;
            int hour        = 0;
            int minute      = 0;
            int second      = 0;
            int millisecond = 0;

            CMathLib.M130(num, ref year, ref month, ref day, ref hour, ref minute, ref second, ref millisecond);
            return(new DateTime(year, month, day, hour, minute, second, millisecond));
        }
Beispiel #2
0
 /// <summary>
 /// 时间转换成Double
 /// </summary>
 /// <param name="date"></param>
 /// <returns></returns>
 public static double ConvertDateToNum(DateTime date)
 {
     return(CMathLib.M129(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, date.Millisecond));
 }