将日期“1900-01-01”从 angular 传递到 wcf

Pass Date '1900-01-01' from angular to wcf

当我跟随json

打电话时
{

      "EndDate": "\/Date(" + date + ")\/"
}

改为1970年

当我在没有日期的情况下调用时,它会抛出序列化问题。

我正在使用 angular 7 和 WCF。

如何将“1900-01-01 00:00:00”从 angular

传递给 wcf

谢谢

JSON 不支持 Date 对象所以你需要使用 timestamp (int) 或 DateString(string) 最后在 WCF

{

  "EndDate":  date.getTime() // Timestamp in ms 
 }