Bitcoin QT Rpc Transaction date format

1

I am trying to get information about my transactions from my wallet,

I use Listtransactions, and get all the information, but the time/blocktime/receivetime - there are all in number i can't decipher "1390424516" i thought they were ticks, but new DateTime(1390424516) gets me 01/01/0001 00:02:19 ... I tried using them as seconds, i got to year 0045...

the documentations says "time" : time associated with the transaction[1]. From block timestamp, unless transaction was already in memory pool then the local time when the client added the transaction to its memory pool

so i tried both methods on Blocktime too, but can't figure out how to get the time...

Royi Mindel

Posted 2014-01-30T09:54:20.173

Reputation: 153

Answers

3

This is a Unix date format. As I understand, you are using c#, so it will be look like:

public static DateTime FromUnixTime(uint time)
{
    return new DateTime(1970, 1, 1).AddSeconds(time);
}

Zergatul

Posted 2014-01-30T09:54:20.173

Reputation: 948