Himall商城ExpressDaDaHelper 日期转换成unix时间戳、转换成字典、生成签名
/// <summary>
/// 日期转换成unix时间戳
/// </summary>
/// <param name="dateTime"></param>
/// <returns></returns>
public static long DateTimeToUnixTimestamp(DateTime dateTime)
{
System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1));
return Convert.ToInt64((dateTime - startTime).TotalSeconds);
}
/// <summary>
/// 转换成字典
/// </summary>
/// <param name="j"></param>
/// <returns></returns>
public static IDictionary<string, object> ToDictionary(JObject j)
{
var result = j.ToObject<Dictionary<string, object>>();
var JObjectKeys = (from r in result