| 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 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 * this method is equivalent to | 121 * this method is equivalent to |
| 122 * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, true):]. | 122 * [:new Date.fromMillisecondsSinceEpoch(millisecondsSinceEpoch, true):]. |
| 123 */ | 123 */ |
| 124 Date toUtc(); | 124 Date toUtc(); |
| 125 | 125 |
| 126 /** | 126 /** |
| 127 * Returns the abbreviated time-zone name. | 127 * Returns the abbreviated time-zone name. |
| 128 * | 128 * |
| 129 * Examples: [:"CET":] or [:"CEST":]. | 129 * Examples: [:"CET":] or [:"CEST":]. |
| 130 */ | 130 */ |
| 131 String get timeZoneName(); | 131 String get timeZoneName; |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * The time-zone offset is the difference between local time and UTC. That is, | 134 * The time-zone offset is the difference between local time and UTC. That is, |
| 135 * the offset is positive for time zones west of UTC. | 135 * the offset is positive for time zones west of UTC. |
| 136 * | 136 * |
| 137 * Note, that JavaScript, Python and C return the difference between UTC and | 137 * Note, that JavaScript, Python and C return the difference between UTC and |
| 138 * local time. Java, C# and Ruby return the difference between local time and | 138 * local time. Java, C# and Ruby return the difference between local time and |
| 139 * UTC. | 139 * UTC. |
| 140 */ | 140 */ |
| 141 Duration get timeZoneOffset(); | 141 Duration get timeZoneOffset; |
| 142 | 142 |
| 143 /** | 143 /** |
| 144 * Returns the year. | 144 * Returns the year. |
| 145 */ | 145 */ |
| 146 int get year(); | 146 int get year; |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * Returns the month into the year [1..12]. | 149 * Returns the month into the year [1..12]. |
| 150 */ | 150 */ |
| 151 int get month(); | 151 int get month; |
| 152 | 152 |
| 153 /** | 153 /** |
| 154 * Returns the day into the month [1..31]. | 154 * Returns the day into the month [1..31]. |
| 155 */ | 155 */ |
| 156 int get day(); | 156 int get day; |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * Returns the hour into the day [0..23]. | 159 * Returns the hour into the day [0..23]. |
| 160 */ | 160 */ |
| 161 int get hour(); | 161 int get hour; |
| 162 | 162 |
| 163 /** | 163 /** |
| 164 * Returns the minute into the hour [0...59]. | 164 * Returns the minute into the hour [0...59]. |
| 165 */ | 165 */ |
| 166 int get minute(); | 166 int get minute; |
| 167 | 167 |
| 168 /** | 168 /** |
| 169 * Returns the second into the minute [0...59]. | 169 * Returns the second into the minute [0...59]. |
| 170 */ | 170 */ |
| 171 int get second(); | 171 int get second; |
| 172 | 172 |
| 173 /** | 173 /** |
| 174 * Returns the millisecond into the second [0...999]. | 174 * Returns the millisecond into the second [0...999]. |
| 175 */ | 175 */ |
| 176 int get millisecond(); | 176 int get millisecond; |
| 177 | 177 |
| 178 /** | 178 /** |
| 179 * Returns the week day [MON..SUN]. In accordance with ISO 8601 | 179 * Returns the week day [MON..SUN]. In accordance with ISO 8601 |
| 180 * a week starts with Monday which has the value 1. | 180 * a week starts with Monday which has the value 1. |
| 181 */ | 181 */ |
| 182 int get weekday(); | 182 int get weekday; |
| 183 | 183 |
| 184 /** | 184 /** |
| 185 * The milliseconds since 1970-01-01T00:00:00Z (UTC). This value is | 185 * The milliseconds since 1970-01-01T00:00:00Z (UTC). This value is |
| 186 * independent of the time zone. | 186 * independent of the time zone. |
| 187 * | 187 * |
| 188 * See [Stopwatch] for means to measure time-spans. | 188 * See [Stopwatch] for means to measure time-spans. |
| 189 */ | 189 */ |
| 190 int get millisecondsSinceEpoch(); | 190 int get millisecondsSinceEpoch; |
| 191 | 191 |
| 192 /** | 192 /** |
| 193 * True if this [Date] is set to UTC time. | 193 * True if this [Date] is set to UTC time. |
| 194 */ | 194 */ |
| 195 bool get isUtc(); | 195 bool get isUtc; |
| 196 | 196 |
| 197 /** | 197 /** |
| 198 * Returns a human readable string for this instance. | 198 * Returns a human readable string for this instance. |
| 199 * The returned string is constructed for the time zone of this instance. | 199 * The returned string is constructed for the time zone of this instance. |
| 200 */ | 200 */ |
| 201 String toString(); | 201 String toString(); |
| 202 | 202 |
| 203 /** | 203 /** |
| 204 * Returns a new [Date] with the [duration] added to this instance. | 204 * Returns a new [Date] with the [duration] added to this instance. |
| 205 */ | 205 */ |
| 206 Date add(Duration duration); | 206 Date add(Duration duration); |
| 207 | 207 |
| 208 /** | 208 /** |
| 209 * Returns a new [Date] with the [duration] subtracted from this instance. | 209 * Returns a new [Date] with the [duration] subtracted from this instance. |
| 210 */ | 210 */ |
| 211 Date subtract(Duration duration); | 211 Date subtract(Duration duration); |
| 212 | 212 |
| 213 /** | 213 /** |
| 214 * Returns a [Duration] with the difference of [:this:] and [other]. | 214 * Returns a [Duration] with the difference of [:this:] and [other]. |
| 215 */ | 215 */ |
| 216 Duration difference(Date other); | 216 Duration difference(Date other); |
| 217 } | 217 } |
| OLD | NEW |