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 interface Date extends Comparable, Hashable default DateImplementation { | 10 interface Date extends Comparable, Hashable default DateImplementation { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 /** | 106 /** |
107 * Returns a new [Date] in the given [targetTimeZone] time zone. The | 107 * Returns a new [Date] in the given [targetTimeZone] time zone. The |
108 * [value] of the new instance is equal to [:this.value:]. | 108 * [value] of the new instance is equal to [:this.value:]. |
109 * | 109 * |
110 * This call is equivalent to | 110 * This call is equivalent to |
111 * [:new Date.fromEpoch(this.value, targetTimeZone):]. | 111 * [:new Date.fromEpoch(this.value, targetTimeZone):]. |
112 */ | 112 */ |
113 Date changeTimeZone(TimeZone targetTimeZone); | 113 Date changeTimeZone(TimeZone targetTimeZone); |
114 | 114 |
115 /** | 115 /** |
116 * Returns the abbreviated time-zone name. | |
117 * | |
118 * Examples: [:"CET":] or [:"CEST":]. | |
119 */ | |
120 String get timeZoneName(); | |
121 | |
122 /** | |
123 * The time-zone offset is the difference between local time and UTC. That is, | |
124 * the offset is positive for time zones west of UTC. | |
125 * | |
126 * Note, that JavaScript, Python and C return the difference between UTC and | |
127 * local time. Java, C# and Ruby return the difference between local time and | |
128 * UTC. | |
129 */ | |
130 Duration get timeZoneOffset(); | |
131 | |
132 /** | |
133 * Returns the year. | 116 * Returns the year. |
134 */ | 117 */ |
135 int get year(); | 118 int get year(); |
136 | 119 |
137 /** | 120 /** |
138 * Returns the month in the year [1..12]. | 121 * Returns the month in the year [1..12]. |
139 */ | 122 */ |
140 int get month(); | 123 int get month(); |
141 | 124 |
142 /** | 125 /** |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 /** | 189 /** |
207 * Returns a new [Date] with the [duration] subtracted from this instance. | 190 * Returns a new [Date] with the [duration] subtracted from this instance. |
208 */ | 191 */ |
209 Date subtract(Duration duration); | 192 Date subtract(Duration duration); |
210 | 193 |
211 /** | 194 /** |
212 * Returns a [Duration] with the difference of [:this:] and [other]. | 195 * Returns a [Duration] with the difference of [:this:] and [other]. |
213 */ | 196 */ |
214 Duration difference(Date other); | 197 Duration difference(Date other); |
215 } | 198 } |
OLD | NEW |