PRExplodedTime 编辑

A clock/calendar representation of times.

Syntax

 #include <prtime.h>

 typedef struct PRExplodedTime {
     PRInt32 tm_usec;
     PRInt32 tm_sec;
     PRInt32 tm_min;
     PRInt32 tm_hour;
     PRInt32 tm_mday;
     PRInt32 tm_month;
     PRInt16 tm_year;
     PRInt8 tm_wday;
     PRInt16 tm_yday;
     /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRTimeParameters tm_params;
 } PRExplodedTime;

Description

The PRExplodedTime structure represents clock/calendar time. PRExplodedTime has the familiar time components: year, month, day of month, hour, minute, second. It also has a microsecond component, as well as the day of week and the day of year. In addition, PRExplodedTime includes a /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRTimeParameters structure representing the local time zone information, so that the time point is non-ambiguously specified.

The essential members of PRExplodedTime are:

  • tm_year: absolute year, AD (by "absolute," we mean if the year is 2000, this field's value is 2000).
  • tm_month: number of months past tm_year. The range is [0, 11]. 0 is January and 11 is December.
  • tm_mday: the day of month. The range is [1, 31]. Note that it starts from 1 as opposed to 0.
  • tm_hour: number of hours past tm_mday. The range is [0, 23].
  • tm_min: number of minutes past tm_hour. The range is [0, 59].
  • tm_sec: number of seconds past tm_min. The range is [0, 61]. The values 60 and 61 are for accommodating up to two leap seconds.
  • tm_usec: number of microseconds past tm_sec. The range is [0, 999999].
  • tm_params: a /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PRTimeParameters structure representing the local time zone information.

The nonessential members of PRExplodedTime are:

  • tm_wday: day of week. The range is [0, 6]. 0 is Sunday, 1 is Monday, and 6 is Saturday.
  • tm_yday: day of year. The range is [0, 365]. 0 is the 1st of January.

On input to NSPR functions, only the essential members of PRExplodedTime must be specified. The two nonessential members (day of week and day of year) are ignored by NSPR functions as input. When an NSPR function returns a PRExplodedTime object or sets a PRExplodedTime object as output, all of the PRExplodedTime members are set, including the nonessential members. You can also use /wiki/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_NormalizeTime() to calculate the values of the nonessential members.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:61 次

字数:3272

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文