prg_date_from_string_convert_tz()
摘要
将指定时区中日期的字符串表示转换为 PrgT_Date。
语法
prg_date_from_string_convert_tz (date_time_string, time_zone, string_format, options, date_time_ptr)
| 参数 | 类型 | 说明 |
|---|---|---|
date_time_string |
const char * |
待转换的日期字符串(不能为空)。 |
time_zone |
PrgT_Timezone_Name |
date_time_string 所使用的时区;为表 1所列符号常量之一。 |
string_format |
PrgT_Date_String_Format |
date_time_string 的格式(参见详情)。 |
options |
int |
转换选项(参见详情)。 |
date_time_ptr |
PrgT_Date * |
接收转换后日期的对象(不能为 NULL)。 |
返回类型
PrgT_Compcode
转换成功时返回 PrgC_Compcode_Success;否则返回 PrgC_Compcode_Failure。
头文件
prg_date.h
详情
该函数将日期的字符串表示转换为 PrgT_Date 对象。
date_time_string 处于指定的 time_zone 时区中。返回的 PrgT_Date 对象表示已转换为计算机本地时间的日期和时间(除非通过 options 另有指定)。
string_format 指定字符串的格式。该值必须是 PrgC_Date_String_Format_Standard,即 C 标准格式的字符串:“12:34:56.789 Mar 19 2008”。
options 必须为 0 或下列符号常量之一:
PRGC_DATE_OPT_USE_TIMEZONE_PREF——转换为 timezone 首选项指定的时区PRGC_DATE_OPT_INCLUDE_TIMEZONE_STR——在返回的字符串中包含时区PRGC_DATE_OPT_INCLUDE_TIMEZONE_STR_USE_PREF——转换为 timezone 首选项指定的时区,并在返回的字符串中包含时区