2012-07-23 08:35:27 +00:00
|
|
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
|
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
|
2021-04-26 17:58:57 +00:00
|
|
|
// @dart = 2.9
|
|
|
|
|
2013-04-05 19:43:16 +00:00
|
|
|
import "package:expect/expect.dart";
|
|
|
|
|
2012-07-23 08:35:27 +00:00
|
|
|
// Make sure the year 0 is correctly printed.
|
|
|
|
|
|
|
|
testUtc() {
|
2013-01-24 12:16:37 +00:00
|
|
|
var d = new DateTime.utc(0, 1, 1);
|
2012-07-23 08:35:27 +00:00
|
|
|
Expect.equals("0000-01-01 00:00:00.000Z", d.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
testLocal() {
|
2013-01-24 12:16:37 +00:00
|
|
|
var d = new DateTime(0, 1, 1);
|
2012-07-23 08:35:27 +00:00
|
|
|
Expect.equals("0000-01-01 00:00:00.000", d.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
testUtc();
|
|
|
|
testLocal();
|
|
|
|
}
|