Ejemplo n.º 1
0
        /// <summary>
        /// 将JS时间格式的数值转换为时间
        /// </summary>
        public static DateTime FromJsGetTime(this long jsTime)
        {
            int length = jsTime.ToString().Length;

            Check.Required <ArgumentException>(length != 10 || length != 13, () => I18n.GetText(LangKeyEnum.JsDateLengthInValid));
            DateTime start  = new DateTime(1970, 1, 1);
            DateTime result = length == 10 ? start.AddSeconds(jsTime) : start.AddMilliseconds(jsTime);

            return(result.FromUtcTime());
        }
Ejemplo n.º 2
0
 private static string GetMessage(CheckEnum @enum)
 {
     return(I18n.GetText(@enum));
 }