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 * An instant in time, such as July 20, 1969, 8:18pm GMT. | 8 * An instant in time, such as July 20, 1969, 8:18pm GMT. |
9 * | 9 * |
10 * Create a DateTime object by using one of the constructors | 10 * Create a DateTime object by using one of the constructors |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 * ## Other resources | 95 * ## Other resources |
96 * | 96 * |
97 * See [Duration] to represent a span of time. | 97 * See [Duration] to represent a span of time. |
98 * See [Stopwatch] to measure timespans. | 98 * See [Stopwatch] to measure timespans. |
99 * | 99 * |
100 * The DateTime class does not provide internationalization. | 100 * The DateTime class does not provide internationalization. |
101 * To internationalize your code, use | 101 * To internationalize your code, use |
102 * the [intl](http://pub.dartlang.org/packages/intl) package. | 102 * the [intl](http://pub.dartlang.org/packages/intl) package. |
103 * | 103 * |
104 */ | 104 */ |
105 class DateTime implements Comparable { | 105 class DateTime implements Comparable<DateTime> { |
106 // Weekday constants that are returned by [weekday] method: | 106 // Weekday constants that are returned by [weekday] method: |
107 static const int MONDAY = 1; | 107 static const int MONDAY = 1; |
108 static const int TUESDAY = 2; | 108 static const int TUESDAY = 2; |
109 static const int WEDNESDAY = 3; | 109 static const int WEDNESDAY = 3; |
110 static const int THURSDAY = 4; | 110 static const int THURSDAY = 4; |
111 static const int FRIDAY = 5; | 111 static const int FRIDAY = 5; |
112 static const int SATURDAY = 6; | 112 static const int SATURDAY = 6; |
113 static const int SUNDAY = 7; | 113 static const int SUNDAY = 7; |
114 static const int DAYS_PER_WEEK = 7; | 114 static const int DAYS_PER_WEEK = 7; |
115 | 115 |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 * In accordance with ISO 8601 | 752 * In accordance with ISO 8601 |
753 * a week starts with Monday, which has the value 1. | 753 * a week starts with Monday, which has the value 1. |
754 * | 754 * |
755 * DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); | 755 * DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); |
756 * assert(moonLanding.weekday == 7); | 756 * assert(moonLanding.weekday == 7); |
757 * assert(moonLanding.weekday == DateTime.SUNDAY); | 757 * assert(moonLanding.weekday == DateTime.SUNDAY); |
758 * | 758 * |
759 */ | 759 */ |
760 external int get weekday; | 760 external int get weekday; |
761 } | 761 } |
OLD | NEW |