toUtcString property

String get toUtcString

Returns this datetime as an ISO-8601 UTC string.

Example:

final date = DateTime(2024, 2, 24, 10, 30);
final utcString = date.toUtcString;
// returns: '2024-02-24T10:30:00.000Z'

Implementation

String get toUtcString => toUtc().toIso8601String();