InvalidTimeZoneException class final
Exception thrown when an invalid timezone location is provided.
This occurs when trying to use a timezone identifier that doesn't exist in the IANA timezone database.
Solution: Use getLocation() with a valid IANA timezone identifier:
// Valid
final tokyo = getLocation('Asia/Tokyo');
// Invalid - will throw
final invalid = getLocation('Invalid/Timezone');
- Implemented types
Constructors
- InvalidTimeZoneException({required String timeZoneId, required String message, ParseDiagnostics? diagnostics})
- Creates a new InvalidTimeZoneException.
Properties
- diagnostics → ParseDiagnostics?
-
Structured metadata describing the failed parse attempt when available.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
The error message explaining why the timezone is invalid.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeZoneId → String
-
The invalid timezone identifier that was provided.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited