1

I'm trying to execute this query with HL Composer v0.19.4. But it always returns an empty array[].

query getTransactionsBetweenIntervalMadeByParticipant{
  description: "Get all transactions made by participant between an interval"
statement:
    SELECT org.hyperledger.composer.system.HistorianRecord
    WHERE ((participantInvoking==_$participantInvoking) AND (_$fromTime>transactionTimestamp) AND (_$toTime<transactionTimestamp))

Which is the right format of the timestamp that must be passed to the query?

(I tried with "yyyy-MM-ddTHH:mm:ss.zzz" and with Unix timestamp but didn't work).

Leonardo Carraro
  • 1,532
  • 1
  • 11
  • 24

1 Answers1

0

the format is "2018-05-11T10:42:21.945Z" (one 'Z') ie 'YYYY-MM-DDTHH:mm:ss.sssZ' or you can provide 'YYYY-MM-DDTHH:mm:ssZ' or 'YYYY-MM-DDTHH:mm:ss:ssZ'

as in:

var dateString = "2018-01-02T11:42Z"; // DateTime however you build it.

var myDate = new Date(dateString);

Not: Obviously doing a new Date() won't be really appropriate in a Transaction Processor (non-deterministic code) as its being deployed to a runtime blockchain and knowing when its evaluated after being endorsed/executed is anyone's guess.

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15