OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************************** | 2 ******************************************************************************** |
3 * Copyright (C) 1997-2014, International Business Machines | 3 * Copyright (C) 1997-2014, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ******************************************************************************** | 5 ******************************************************************************** |
6 * | 6 * |
7 * File CALENDAR.H | 7 * File CALENDAR.H |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 * | 120 * |
121 * \htmlonly<blockquote>\endhtmlonly | 121 * \htmlonly<blockquote>\endhtmlonly |
122 * <pre> | 122 * <pre> |
123 * HOUR_OF_DAY | 123 * HOUR_OF_DAY |
124 * AM_PM + HOUR | 124 * AM_PM + HOUR |
125 * </pre> | 125 * </pre> |
126 * \htmlonly</blockquote>\endhtmlonly | 126 * \htmlonly</blockquote>\endhtmlonly |
127 * | 127 * |
128 * <p> | 128 * <p> |
129 * <strong>Ambiguous Wall Clock Time.</strong> When time offset from UTC has | 129 * <strong>Ambiguous Wall Clock Time.</strong> When time offset from UTC has |
130 * changed, it produces ambiguous time slot around the transition. For example, | 130 * changed, it produces an ambiguous time slot around the transition. For exampl
e, |
131 * many US locations observe daylight saving time. On the date switching to dayl
ight | 131 * many US locations observe daylight saving time. On the date switching to dayl
ight |
132 * saving time in US, wall clock time jumps from 1:00 AM (standard) to 2:00 AM | 132 * saving time in US, wall clock time jumps from 12:59 AM (standard) to 2:00 AM |
133 * (daylight). Therefore, wall clock time from 1:00 AM to 1:59 AM do not exist o
n | 133 * (daylight). Therefore, wall clock time from 1:00 AM to 1:59 AM do not exist o
n |
134 * the date. When the input wall time fall into this missing time slot, the ICU | 134 * the date. When the input wall time fall into this missing time slot, the ICU |
135 * Calendar resolves the time using the UTC offset before the transition by defa
ult. | 135 * Calendar resolves the time using the UTC offset before the transition by defa
ult. |
136 * In this example, 1:30 AM is interpreted as 1:30 AM standard time (non-exist), | 136 * In this example, 1:30 AM is interpreted as 1:30 AM standard time (non-exist), |
137 * so the final result will be 2:30 AM daylight time. | 137 * so the final result will be 2:30 AM daylight time. |
138 * | 138 * |
139 * <p>On the date switching back to standard time, wall clock time is moved back
one | 139 * <p>On the date switching back to standard time, wall clock time is moved back
one |
140 * hour at 2:00 AM. So wall clock time from 1:00 AM to 1:59 AM occur twice. In t
his | 140 * hour at 2:00 AM. So wall clock time from 1:00 AM to 1:59 AM occur twice. In t
his |
141 * case, the ICU Calendar resolves the time using the UTC offset after the trans
ition | 141 * case, the ICU Calendar resolves the time using the UTC offset after the trans
ition |
142 * by default. For example, 1:30 AM on the date is resolved as 1:30 AM standard
time. | 142 * by default. For example, 1:30 AM on the date is resolved as 1:30 AM standard
time. |
(...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2454 BasicTimeZone* getBasicTimeZone() const; | 2454 BasicTimeZone* getBasicTimeZone() const; |
2455 | 2455 |
2456 /** | 2456 /** |
2457 * Find the previous zone transtion near the given time. | 2457 * Find the previous zone transtion near the given time. |
2458 * @param base The base time, inclusive | 2458 * @param base The base time, inclusive |
2459 * @param transitionTime Receives the result time | 2459 * @param transitionTime Receives the result time |
2460 * @param status The error status | 2460 * @param status The error status |
2461 * @return TRUE if a transition is found. | 2461 * @return TRUE if a transition is found. |
2462 */ | 2462 */ |
2463 UBool getImmediatePreviousZoneTransition(UDate base, UDate *transitionTime,
UErrorCode& status) const; | 2463 UBool getImmediatePreviousZoneTransition(UDate base, UDate *transitionTime,
UErrorCode& status) const; |
| 2464 |
| 2465 public: |
| 2466 #ifndef U_HIDE_INTERNAL_API |
| 2467 /** |
| 2468 * Creates a new Calendar from a Locale for the cache. |
| 2469 * This method does not set the time or timezone in returned calendar. |
| 2470 * @param locale the locale. |
| 2471 * @param status any error returned here. |
| 2472 * @return the new Calendar object with no time or timezone set. |
| 2473 * @internal For ICU use only. |
| 2474 */ |
| 2475 static Calendar * U_EXPORT2 makeInstance( |
| 2476 const Locale &locale, UErrorCode &status); |
| 2477 |
| 2478 /** |
| 2479 * Get the calendar type for given locale. |
| 2480 * @param locale the locale |
| 2481 * @param typeBuffer calendar type returned here |
| 2482 * @param typeBufferSize The size of typeBuffer in bytes. If the type |
| 2483 * can't fit in the buffer, this method sets status to |
| 2484 * U_BUFFER_OVERFLOW_ERROR |
| 2485 * @param status error, if any, returned here. |
| 2486 * @internal For ICU use only. |
| 2487 */ |
| 2488 static void U_EXPORT2 getCalendarTypeFromLocale( |
| 2489 const Locale &locale, |
| 2490 char *typeBuffer, |
| 2491 int32_t typeBufferSize, |
| 2492 UErrorCode &status); |
| 2493 #endif /* U_HIDE_INTERNAL_API */ |
2464 }; | 2494 }; |
2465 | 2495 |
2466 // ------------------------------------- | 2496 // ------------------------------------- |
2467 | 2497 |
2468 inline Calendar* | 2498 inline Calendar* |
2469 Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode) | 2499 Calendar::createInstance(TimeZone* zone, UErrorCode& errorCode) |
2470 { | 2500 { |
2471 // since the Locale isn't specified, use the default locale | 2501 // since the Locale isn't specified, use the default locale |
2472 return createInstance(zone, Locale::getDefault(), errorCode); | 2502 return createInstance(zone, Locale::getDefault(), errorCode); |
2473 } | 2503 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 { | 2540 { |
2511 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek); | 2541 return weekNumber(dayOfPeriod, dayOfPeriod, dayOfWeek); |
2512 } | 2542 } |
2513 #endif /* U_HIDE_INTERNAL_API */ | 2543 #endif /* U_HIDE_INTERNAL_API */ |
2514 | 2544 |
2515 U_NAMESPACE_END | 2545 U_NAMESPACE_END |
2516 | 2546 |
2517 #endif /* #if !UCONFIG_NO_FORMATTING */ | 2547 #endif /* #if !UCONFIG_NO_FORMATTING */ |
2518 | 2548 |
2519 #endif // _CALENDAR | 2549 #endif // _CALENDAR |
OLD | NEW |