OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.io; | 5 part of "io.dart"; |
6 | 6 |
7 /** | 7 /** |
8 * Utility functions for working with dates with HTTP specific date | 8 * Utility functions for working with dates with HTTP specific date |
9 * formats. | 9 * formats. |
10 */ | 10 */ |
11 class HttpDate { | 11 class HttpDate { |
12 // From RFC-2616 section "3.3.1 Full Date", | 12 // From RFC-2616 section "3.3.1 Full Date", |
13 // http://tools.ietf.org/html/rfc2616#section-3.3.1 | 13 // http://tools.ietf.org/html/rfc2616#section-3.3.1 |
14 // | 14 // |
15 // HTTP-date = rfc1123-date | rfc850-date | asctime-date | 15 // HTTP-date = rfc1123-date | rfc850-date | asctime-date |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 int hour = toInt(timeList[0]); | 379 int hour = toInt(timeList[0]); |
380 int minute = toInt(timeList[1]); | 380 int minute = toInt(timeList[1]); |
381 int second = toInt(timeList[2]); | 381 int second = toInt(timeList[2]); |
382 if (hour > 23) error(); | 382 if (hour > 23) error(); |
383 if (minute > 59) error(); | 383 if (minute > 59) error(); |
384 if (second > 59) error(); | 384 if (second > 59) error(); |
385 | 385 |
386 return new DateTime.utc(year, month, dayOfMonth, hour, minute, second, 0); | 386 return new DateTime.utc(year, month, dayOfMonth, hour, minute, second, 0); |
387 } | 387 } |
388 } | 388 } |
OLD | NEW |