timeZone property

double get timeZone

获取时区

Implementation

double get timeZone {
  DateTime _local = DateTime.now();
  DateTime _localUtc = _local.toUtc();
  DateTime _nowUtc = DateTime.utc(_local.year, _local.month, _local.day,
      _local.hour, _local.minute, _local.second);
  DateTime _utc = DateTime.utc(_localUtc.year, _localUtc.month, _localUtc.day,
      _localUtc.hour, _localUtc.minute, _localUtc.second);
  Duration _d = _nowUtc.difference(_utc);
  return _d.inMinutes / 60.0;
}