DateFormat.GetTimeInstance 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| GetTimeInstance(Int32) |
获取具有默认 |
| GetTimeInstance(Int32, Locale) |
获取具有给定区域设置的给定格式样式的时间格式化程序。 |
GetTimeInstance(Int32)
获取具有默认 java.util.Locale.Category#FORMAT FORMAT 区域设置的给定格式样式的时间格式化程序。
[Android.Runtime.Register("getTimeInstance", "(I)Ljava/text/DateFormat;", "")]
public static Java.Text.DateFormat GetTimeInstance(int style);
[<Android.Runtime.Register("getTimeInstance", "(I)Ljava/text/DateFormat;", "")>]
static member GetTimeInstance : int -> Java.Text.DateFormat
参数
- style
- Int32
给定的格式样式。 例如,美国区域设置中“h:mm a”的 SHORT。
返回
时间格式化程序。
- 属性
例外
如果 style 不是 SHORT、MEDIUM、LONG、FULL 或 DEFAULT 之一。
注解
获取具有默认 java.util.Locale.Category#FORMAT FORMAT 区域设置的给定格式样式的时间格式化程序。
这相当于调用 #getTimeInstance(int, Locale) getTimeInstance(style, Locale.getDefault(Locale.Category.FORMAT))。
Java文档java.text.DateFormat.getTimeInstance(int)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。
适用于
GetTimeInstance(Int32, Locale)
获取具有给定区域设置的给定格式样式的时间格式化程序。
[Android.Runtime.Register("getTimeInstance", "(ILjava/util/Locale;)Ljava/text/DateFormat;", "")]
public static Java.Text.DateFormat GetTimeInstance(int style, Java.Util.Locale aLocale);
[<Android.Runtime.Register("getTimeInstance", "(ILjava/util/Locale;)Ljava/text/DateFormat;", "")>]
static member GetTimeInstance : int * Java.Util.Locale -> Java.Text.DateFormat
参数
- style
- Int32
给定的格式样式。 例如,美国区域设置中“h:mm a”的 SHORT。
- aLocale
- Locale
给定的区域设置。
返回
时间格式化程序。
- 属性
例外
如果 style 不是 SHORT、MEDIUM、LONG、FULL 或 DEFAULT 之一。
注解
获取具有给定区域设置的给定格式样式的时间格式化程序。
Java文档java.text.DateFormat.getTimeInstance(int, java.util.Locale)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。