/// <summary> /// 静态初始化 /// </summary> static TimeUnitUtils() { scales = CollectionUtils.AsDictionary <TimeUnit, long>( TimeUnit.year, (long)365 * 24 * 60 * 60 * 1000, TimeUnit.quarter, (long)3 * 30 * 24 * 60 * 60 * 1000, TimeUnit.month, (long)30 * 24 * 60 * 60 * 1000, TimeUnit.week, (long)7 * 24 * 60 * 60 * 1000, TimeUnit.day, (long)24 * 60 * 60 * 1000, TimeUnit.hour, (long)60 * 60 * 1000, TimeUnit.minute, (long)60 * 1000, TimeUnit.second, (long)1000, TimeUnit.millsecond, (long)1 ); units = CollectionUtils.AsDictionary <TimeUnit, String[]>( TimeUnit.year, new String[] { "年", "y", "year", "years" }, TimeUnit.quarter, new String[] { "季度", "q", "quarters", "quarter" }, TimeUnit.month, new String[] { "月", "m", "months", "month" }, TimeUnit.week, new String[] { "周", "w", "weeks", "week" }, TimeUnit.day, new String[] { "日", "d", "days", "day" }, TimeUnit.hour, new String[] { "时", "小时", "h", "hours", "hour" }, TimeUnit.minute, new String[] { "分", "分钟", "m", "minutes", "minute" }, TimeUnit.second, new String[] { "秒", "秒钟", "s", "seconds", "second" }, TimeUnit.millsecond, new String[] { "毫秒", "ms", "millsecond", "millseconds" } ); ConvertUtils.RegisteConvertor <String, TimeUnit>(Parse); }