dateToBlockTimestamp function

int dateToBlockTimestamp(
  1. String date
)

Convert date in ISO format to block_timestamp_type (half-seconds since a different epoch) */

Implementation

int dateToBlockTimestamp(String date) {
  return ((checkDateParse(date + 'Z').subtract(Duration(milliseconds: 946684800000))).millisecondsSinceEpoch / 500)
      .round();
}