OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // Dart core library. | 5 // Dart core library. |
6 | 6 |
7 /** | 7 /** |
8 * Date is the public interface to a point in time. | 8 * Date is the public interface to a point in time. |
9 * | 9 * |
10 * It can represent time values that are at a distance of at most | 10 * It can represent time values that are at a distance of at most |
11 * 8,640,000,000,000,000ms (100,000,000 days) from epoch (1970-01-01 UTC). In | 11 * 8,640,000,000,000,000ms (100,000,000 days) from epoch (1970-01-01 UTC). In |
12 * other words: [:millisecondsSinceEpoch.abs() <= 8640000000000000:]. | 12 * other words: [:millisecondsSinceEpoch.abs() <= 8640000000000000:]. |
13 * | 13 * |
14 * Also see [Stopwatch] for means to measure time-spans. | 14 * Also see [Stopwatch] for means to measure time-spans. |
15 */ | 15 */ |
16 abstract class Date implements Comparable, Hashable { | 16 abstract class Date implements Comparable { |
17 // Weekday constants that are returned by [weekday] method: | 17 // Weekday constants that are returned by [weekday] method: |
18 static const int MON = 1; | 18 static const int MON = 1; |
19 static const int TUE = 2; | 19 static const int TUE = 2; |
20 static const int WED = 3; | 20 static const int WED = 3; |
21 static const int THU = 4; | 21 static const int THU = 4; |
22 static const int FRI = 5; | 22 static const int FRI = 5; |
23 static const int SAT = 6; | 23 static const int SAT = 6; |
24 static const int SUN = 7; | 24 static const int SUN = 7; |
25 static const int DAYS_IN_WEEK = 7; | 25 static const int DAYS_IN_WEEK = 7; |
26 | 26 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 /** | 216 /** |
217 * Returns a new [Date] with the [duration] subtracted from this instance. | 217 * Returns a new [Date] with the [duration] subtracted from this instance. |
218 */ | 218 */ |
219 Date subtract(Duration duration); | 219 Date subtract(Duration duration); |
220 | 220 |
221 /** | 221 /** |
222 * Returns a [Duration] with the difference of [:this:] and [other]. | 222 * Returns a [Duration] with the difference of [:this:] and [other]. |
223 */ | 223 */ |
224 Duration difference(Date other); | 224 Duration difference(Date other); |
225 } | 225 } |
OLD | NEW |