/// <summary> /// DateTime时间格式转换为Unix时间戳格式 /// </summary> /// <param name=”time”></param> /// <returns></returns> public static int ConvertDateTimeInt(System.DateTime time) { System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); return (int)(time - startTime).TotalSeconds; }
时间: 2024-10-11 07:41:51