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 16 matching lines...) Expand all Loading... |
27 * | 27 * |
28 * You can use properties to get | 28 * You can use properties to get |
29 * the individual units of a DateTime object. | 29 * the individual units of a DateTime object. |
30 * | 30 * |
31 * assert(berlinWallFell.month == 11); | 31 * assert(berlinWallFell.month == 11); |
32 * assert(moonLanding.hour == 20); | 32 * assert(moonLanding.hour == 20); |
33 * | 33 * |
34 * For convenience and readability, | 34 * For convenience and readability, |
35 * the DateTime class provides a constant for each day and month | 35 * the DateTime class provides a constant for each day and month |
36 * name—for example, [AUGUST] and [FRIDAY]. | 36 * name—for example, [AUGUST] and [FRIDAY]. |
37 * You can use these constants to improve code readibility: | 37 * You can use these constants to improve code readability: |
38 * | 38 * |
39 * DateTime berlinWallFell = new DateTime(1989, DateTime.NOVEMBER, 9); | 39 * DateTime berlinWallFell = new DateTime(1989, DateTime.NOVEMBER, 9); |
40 * assert(berlinWallFell.weekday == DateTime.THURSDAY); | 40 * assert(berlinWallFell.weekday == DateTime.THURSDAY); |
41 * | 41 * |
42 * Day and month values begin at 1, and the week starts on Monday. | 42 * Day and month values begin at 1, and the week starts on Monday. |
43 * That is, the constants [JANUARY] and [MONDAY] are both 1. | 43 * That is, the constants [JANUARY] and [MONDAY] are both 1. |
44 * | 44 * |
45 * ## Working with UTC and local time | 45 * ## Working with UTC and local time |
46 * | 46 * |
47 * A DateTime object is in the local time zone | 47 * A DateTime object is in the local time zone |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 * then optionally a two digit seconds value, and | 211 * then optionally a two digit seconds value, and |
212 * then optionally a '.' followed by a one-to-six digit second fraction. | 212 * then optionally a '.' followed by a one-to-six digit second fraction. |
213 * The minutes and seconds may be separated from the previous parts by a | 213 * The minutes and seconds may be separated from the previous parts by a |
214 * ':'. | 214 * ':'. |
215 * Examples: "12", "12:30:24.124", "123010.50". | 215 * Examples: "12", "12:30:24.124", "123010.50". |
216 * * An optional time-zone offset part, | 216 * * An optional time-zone offset part, |
217 * possibly separated from the previous by a space. | 217 * possibly separated from the previous by a space. |
218 * The time zone is either 'z' or 'Z', or it is a signed two digit hour | 218 * The time zone is either 'z' or 'Z', or it is a signed two digit hour |
219 * part and an optional two digit minute part. The sign must be either | 219 * part and an optional two digit minute part. The sign must be either |
220 * "+" or "-", and can not be omitted. | 220 * "+" or "-", and can not be omitted. |
221 * The minutes may be separted from the hours by a ':'. | 221 * The minutes may be separated from the hours by a ':'. |
222 * Examples: "Z", "-10", "01:30", "1130". | 222 * Examples: "Z", "-10", "01:30", "1130". |
223 * | 223 * |
224 * This includes the output of both [toString] and [toIso8601String], which | 224 * This includes the output of both [toString] and [toIso8601String], which |
225 * will be parsed back into a `DateTime` object with the same time as the | 225 * will be parsed back into a `DateTime` object with the same time as the |
226 * original. | 226 * original. |
227 * | 227 * |
228 * The result is always in either local time or UTC. | 228 * The result is always in either local time or UTC. |
229 * If a time zone offset other than UTC is specified, | 229 * If a time zone offset other than UTC is specified, |
230 * the time is converted to the equivalent UTC time. | 230 * the time is converted to the equivalent UTC time. |
231 * | 231 * |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 * In accordance with ISO 8601 | 767 * In accordance with ISO 8601 |
768 * a week starts with Monday, which has the value 1. | 768 * a week starts with Monday, which has the value 1. |
769 * | 769 * |
770 * DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); | 770 * DateTime moonLanding = DateTime.parse("1969-07-20 20:18:00"); |
771 * assert(moonLanding.weekday == 7); | 771 * assert(moonLanding.weekday == 7); |
772 * assert(moonLanding.weekday == DateTime.SUNDAY); | 772 * assert(moonLanding.weekday == DateTime.SUNDAY); |
773 * | 773 * |
774 */ | 774 */ |
775 external int get weekday; | 775 external int get weekday; |
776 } | 776 } |
OLD | NEW |