parse method

Timestamp parse(
  1. String text
)

The function parses a subset of ISO 8601 which includes the subset accepted by RFC 3339.

Compare to DateTime.parse, it supports nanoseconds resolution

Implementation

static Timestamp parse(String text) {
  if (text == null) {
    throw ArgumentError.notNull(text);
  } else {
    var timestamp = tryParse(text);
    if (timestamp == null) {
      throw FormatException('timestamp $text');
    }
    return timestamp;
  }
}