The time stamp of Wechat's JSSDK signature

according to the description in the 1-JS-SDK usage permission signature algorithm in Appendix JS-SDK of Wechat JS-SDK ( URL is here ), a signature needs to be calculated when using jssdk, and a timestamp needs to be provided when calculating the signature.

The

code is Cmursharp. As far as I understand it, a timestamp is a number, but it is found that not all numbers can be used as timestamps. The conclusions of current observation are as follows:

DateTime.Now.ToFileTime ()
No

DateTime.Now.ToFileTime () / 10000
can

DateTime.Today.ToFileTime ()
can

but the document does not say what kind of numbers are not allowed. I don"t know if there are any brothers who know.


4-byte digits can be used for timestamping (up to 10 digits of decimal length)
several of the methods you send return values that are too long


this is recommended:

TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
return Convert.ToInt64(ts.TotalSeconds).ToString();
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eab53a-2047.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eab53a-2047.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?