我想知道这个.NET代码相当于javascript和prequest脚本postman:
private string GetRequestTimeStamp()
{
DateTime epochStart = new DateTime(1970, 01, 01, 0, 0, 0, 0,
DateTimeKind.Utc);
TimeSpan timeSpan = DateTime.UtcNow - epochStart;
string requestTimeStamp = Convert.ToUInt64(timeSpan.TotalSeconds).ToString();
return requestTimeStamp;
}
我尝试了这个,但它不一致
function epochTime()
{
var d = new Date();
var t = d.getTime();
var o = t + "";
return o.substring(0, 10);
}