| 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 part of dart.core; | 5 part of dart.core; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * A DateTime object represents a point in time. | 8 * A DateTime object represents 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 class DateTime { | 16 class DateTime { |
| 17 // Weekday constants that are returned by [weekday] method: | 17 // Weekday constants that are returned by [weekday] method: |
| 18 static const int MONDAY = 1; | 18 static const int MONDAY = 1; |
| 19 static const int TUESDAY = 2; | 19 static const int TUESDAY = 2; |
| 20 static const int WEDNESDAY = 3; | 20 static const int WEDNESDAY = 3; |
| 21 static const int THURSDAY = 4; | 21 static const int THURSDAY = 4; |
| 22 static const int FRIDAY = 5; | 22 static const int FRIDAY = 5; |
| 23 static const int SATURDAY = 6; | 23 static const int SATURDAY = 6; |
| 24 static const int SUNDAY = 7; | 24 static const int SUNDAY = 7; |
| 25 static const int DAYS_IN_WEEK = 7; | 25 static const int DAYS_PER_WEEK = 7; |
| 26 | 26 |
| 27 // Month constants that are returned by the [month] getter. | 27 // Month constants that are returned by the [month] getter. |
| 28 static const int JANUARY = 1; | 28 static const int JANUARY = 1; |
| 29 static const int FEBRUARY = 2; | 29 static const int FEBRUARY = 2; |
| 30 static const int MARCH = 3; | 30 static const int MARCH = 3; |
| 31 static const int APRIL = 4; | 31 static const int APRIL = 4; |
| 32 static const int MAY = 5; | 32 static const int MAY = 5; |
| 33 static const int JUNE = 6; | 33 static const int JUNE = 6; |
| 34 static const int JULY = 7; | 34 static const int JULY = 7; |
| 35 static const int AUGUST = 8; | 35 static const int AUGUST = 8; |
| 36 static const int SEPTEMBER = 9; | 36 static const int SEPTEMBER = 9; |
| 37 static const int OCTOBER = 10; | 37 static const int OCTOBER = 10; |
| 38 static const int NOVEMBER = 11; | 38 static const int NOVEMBER = 11; |
| 39 static const int DECEMBER = 12; | 39 static const int DECEMBER = 12; |
| 40 static const int MONTHS_PER_YEAR = 12; |
| 40 | 41 |
| 41 /** | 42 /** |
| 42 * The milliseconds since 1970-01-01T00:00:00Z (UTC). This value is | 43 * The milliseconds since 1970-01-01T00:00:00Z (UTC). This value is |
| 43 * independent of the time zone. | 44 * independent of the time zone. |
| 44 * | 45 * |
| 45 * See [Stopwatch] for means to measure time-spans. | 46 * See [Stopwatch] for means to measure time-spans. |
| 46 */ | 47 */ |
| 47 final int millisecondsSinceEpoch; | 48 final int millisecondsSinceEpoch; |
| 48 | 49 |
| 49 /** | 50 /** |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 * Returns the millisecond into the second [0...999]. | 371 * Returns the millisecond into the second [0...999]. |
| 371 */ | 372 */ |
| 372 external int get millisecond; | 373 external int get millisecond; |
| 373 | 374 |
| 374 /** | 375 /** |
| 375 * Returns the week day [MON..SUN]. In accordance with ISO 8601 | 376 * Returns the week day [MON..SUN]. In accordance with ISO 8601 |
| 376 * a week starts with Monday which has the value 1. | 377 * a week starts with Monday which has the value 1. |
| 377 */ | 378 */ |
| 378 external int get weekday; | 379 external int get weekday; |
| 379 } | 380 } |
| OLD | NEW |