generateDatetime static method

String generateDatetime()

Implementation

static String generateDatetime() {
  return DateTime.now()
      .toUtc()
      .toString()
      .replaceAll(RegExp(r'\.\d*Z$'), 'Z')
      .replaceAll(RegExp(r'[:-]|\.\d{3}'), '')
      .split(' ')
      .join('T');
}