ConvertJavaMiliSecondToDateTime
摘要:private static DateTime ConvertJavaMiliSecondToDateTime(long javaMS) { DateTime UTCBaseTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); DateTime dt = UTCBaseTime.Add(new TimeSpan(javaMS * TimeSpan.TicksPerMillisecond)).ToLocalTime(); return dt; }
阅读全文
posted @
2013-08-19 16:33
fery
阅读(403)
推荐(0)
中文数字大小写转阿拉伯数字
摘要:目前只支持”万“以下的转换。private static string GetNumber4Chinese(string str) { string istr = "0"; string cstr = string.Empty; string nstr = string.Empty; for (int i = 0; i < str.Length; i++) { cstr = str.Substring(i, 1); nstr = (i < str.Length - 1) ? str.Substring(i + 1, 1) : "个"; swi
阅读全文
posted @
2013-08-13 14:04
fery
阅读(728)
推荐(0)
泛型List 扩展 比较类
摘要:List outputList = resultList.Distinct(new Compare((x, y) => (null != x && null != y) && (x == y))).ToList();//去除重复项#region 泛型类扩展 public delegate bool EqualsComparer(T x, T y); public class Compare : IEqualityComparer { private EqualsComparer _equalsComparer; public Compare(EqualsC
阅读全文