6
我有這樣的任務來填充此字段:如何創建秒時間戳
x_fp_timestamp is the timestamp created when the form is generated. It is equal to the number of seconds since January 1, 1970 in UTC (Coordinated Universal Time).
所以我在C#中做的是
long ts = DateTime.Now.Ticks/TimeSpan.TicksPerSecond;
但在這種情況下,我得到這個錯誤:
- x_fp_timestamp : x_fp_timestamp invalid. Not within 15 minutes of present time: Thu Jan 10 21:30:25 GMT 2013. Expected 1357853425 plus/minus 900, but received 63493442997.
所以我的問題是如何在幾秒鐘內生成當前時間戳?
可能重複:http://stackoverflow.com/questions/3354893/how-can-i-convert-a-datetime-to-the-number-of-seconds-since -1970 –
這裏是一個很好的鏈接,看看它有很多很棒的其他示例以及Peretz [將DateTime對象轉換爲unix時間戳編號](http://www.java2s.com/Code/CSharp/Date-Time /ConvertsaDateTimeobjectintoaunixtimestampnumber.htm) – MethodMan