c# 时间操作,时间搓等
电脑版发表于:2019/6/19 17:59
格式化成:年月日时分秒
string timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");
带点连接符
DateTime.Now.ToString("yyyy-MM-dd HH:mm")
毫秒级时间搓
string timestamp = ((DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000).ToString();
秒级时间搓
string timestamp = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000.ToString();