prg_date_range_to_string_convert_tz()

摘要

将 PrgT 起始与结束日期对象转换为指定时区的日期范围字符串。

语法

prg_date_range_to_string_convert_tz (start_date_time, end_date_time, time_zone, string_format, options, date_time_string, buffer_len)
参数 类型 说明
start_date_time PrgT_Date 待转换的起始日期对象。
end_date_time PrgT_Date 待转换的结束日期对象。
time_zone PrgT_Timezone_Name 要转换到的时区
string_format PrgT_Date_String_Format 期望的字符串格式(参见详情)。
options int 转换选项(参见详情)。
date_time_range_string char * 用于保存转换后字符串的缓冲区。
buffer_len int * date_time_string 缓冲区的大小。
若 date_time_string 太小而无法容纳转换后的字符串,该值将被设置为所需大小,并返回 PrgC_Compcode_Failure。

返回类型

PrgT_Compcode

若输入无效或缓冲区大小不足,返回 PrgC_Compcode_Failure;否则返回 PrgC_Compcode_Success。

头文件

prg_date.h

详情

该函数将两个 PrgT_Date 对象转换为以日期范围表示的字符串。两个日期共有的信息不会在日期范围字符串中重复。例如:

  • Start Date: 11:37:44.000 Dec 23 2011
  • End Date: 12:37:44.000 Dec 23 2011
  • Date Range String: 11:37:44.000 - 12:37:44.000 Dec 23 2011 (EST)

除非通过 options 另有指定,date_time 被视为计算机的本地时间。返回的字符串表示已转换为指定时区的日期和时间。

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 首选项指定的时区,并在返回的字符串中包含时区

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com