DateTimeZone.FromText
根据本地、通用和自定义 datetimezone 格式创建 datetimezone。
Syntax
DateTimeZone.FromText(
text as text,
optional options as any
) as datetimezone
Remarks
根据文本表示形式 text 创建 datetimezone 值。可以提供可选的 record 参数 options 来指定其他属性。record 可包含以下字段:
Format: 指示要使用的格式的text值。要了解更多详细信息,请转到 https://go.microsoft.com/fwlink/?linkid=2180104 和 https://go.microsoft.com/fwlink/?linkid=2180105。省略此字段或提供null将尽力分析日期。Culture: 如果Format不为 null,则Culture将控制某些格式说明符。例如,在"en-US"中"MMM"为"Jan", "Feb", "Mar", ...,而在"ru-RU"中,"MMM"为"янв", "фев", "мар", ...。当Format为null时,Culture会控制要使用的默认格式。当Culture为null或省略时,将使用Culture.Current。
要支持旧版工作流,options 也可以是文本值。这与 options = [Format = null, Culture = options] 时的行为相同。