blockTimestampToDate function

String blockTimestampToDate(
  1. int slot
)

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

Implementation

String blockTimestampToDate(int slot) {
  var s = DateTime.fromMillisecondsSinceEpoch(slot * 500 + 946684800000)
      .toIso8601String();
  return s.substring(0, s.length - 1);
}