Spec-Zone.ru › Dart 1

dart:core

Метод оператор ==

bool оператор ==(other)

Возвращает true, если other является DateTime в тот же момент и в той же временной зоне (UTC или локальной).

DateTime dDayUtc   = new DateTime.utc(1944, DateTime.JUNE, 6);
DateTime dDayLocal = new DateTime(1944, DateTime.JUNE, 6);

assert(dDayUtc.isAtSameMomentAs(dDayLocal) == false);

См. isAtSameMomentAs для сравнения, которое учитывает временную зону.

Исходный код

bool operator ==(other) {
  if (!(other is DateTime)) return false;
  return (_value == other._value && isUtc == other.isUtc);
}

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dartlang.org/stable/1.24.3/dart-core/DateTime/operator_equals.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API