nowLocalAsIso8601 top-level property

String get nowLocalAsIso8601

Gets the current local date and time as an ISO 8601 string.

This is a convenience getter that returns the current UTC time converted to local time with the appropriate timezone offset in ISO 8601 format.

Note: you can mock the current time by setting the nowKey in the Zone to a valid Now function that returns a UTC DateTime.

Example:

final localTimeString = nowLocalAsIso8601;  // "2024-03-20T14:30:00.000+10:00"

Implementation

String get nowLocalAsIso8601 => nowLocal.toIso8601String();