getTimezoneInfoTimezoneIdSync static method
Synchronously gets timezone info based on a timezone ID and a timestamp
Parameters
- IN timezoneId The IANA timezone identifier (e.g., "America/New_York") for which the timezone result is requested
- IN time The time for which offsets are calculated (UTC)
Returns
- A TimezoneResult if the operation was successful,
null
otherwise
Throws
- An exception if it fails.
Implementation
static TimezoneResult? getTimezoneInfoTimezoneIdSync({
required final String timezoneId,
required final DateTime time,
}) {
final TimezoneResult result = TimezoneResult.create();
final OperationResult resultString = staticMethod(
'TimezoneService',
'getTimezoneInfoTimezoneIdSync',
args: <String, dynamic>{
'timezoneResult': result.pointerId,
'timezoneId': timezoneId,
'time': time.millisecondsSinceEpoch,
},
);
if (resultString['result'] != 0) {
return null;
}
return result;
}