From 67359407684d02f7d5e3deb9364bdb645269498f Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Wed, 17 Oct 2012 04:41:19 +0000 Subject: [PATCH] ICU-9250 Document that date format S+ fields truncate for S,SS and zero-pad for SSSS+ X-SVN-Rev: 32646 --- icu4c/source/i18n/unicode/smpdtfmt.h | 1 + icu4c/source/i18n/unicode/udat.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/icu4c/source/i18n/unicode/smpdtfmt.h b/icu4c/source/i18n/unicode/smpdtfmt.h index 170dbebbc9a..aec9c041fa6 100644 --- a/icu4c/source/i18n/unicode/smpdtfmt.h +++ b/icu4c/source/i18n/unicode/smpdtfmt.h @@ -82,6 +82,7 @@ class TimeZoneFormat; * m minute in hour (Number) 30 * s second in minute (Number) 55 * S fractional second (Number) 978 + * (maximum resolution of SSS; truncated if shorter, zero-padded if longer) * E day of week (Text) Tuesday * e day of week (local 1~7) (Text & Number) Tues & 2 * D day in year (Number) 189 diff --git a/icu4c/source/i18n/unicode/udat.h b/icu4c/source/i18n/unicode/udat.h index 89a1106c321..ede0b1ece17 100644 --- a/icu4c/source/i18n/unicode/udat.h +++ b/icu4c/source/i18n/unicode/udat.h @@ -534,6 +534,14 @@ typedef enum UDateFormatField { /** * FieldPosition and UFieldPosition selector for 'S' field alignment, * corresponding to the UCAL_MILLISECOND field. + * + * Note: Time formats that use 'S' can display a maximum of three + * significant digits for fractional seconds, corresponding to millisecond + * resolution and a fractional seconds sub-pattern of SSS. If the + * sub-pattern is S or SS, the fractional seconds value will be truncated + * (not rounded) to the number of display places specified. If the + * fractional seconds sub-pattern is longer than SSS, the additional + * display places will be filled with zeros. * @stable ICU 3.0 */ UDAT_FRACTIONAL_SECOND_FIELD = 8, -- 2.40.0