除去字符串中非数字的字符&&时间转为Long型

来源:互联网 发布:淘宝外围活动 编辑:程序博客网 时间:2024/05/17 08:25
string date=Convert.ToString(DateTime.Now);

            long dates = Convert.ToInt64(Regex.Replace(date, @"[^0-9]", ""));

//将时间转为Long类型  Ticks精确到微秒

long da=DateTime.Now.Ticks;

原创粉丝点击