File: prexplodedtime.rst

package info (click to toggle)
firefox 149.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,767,760 kB
  • sloc: cpp: 7,416,064; javascript: 6,752,859; ansic: 3,774,850; python: 1,250,473; xml: 641,578; asm: 439,191; java: 186,617; sh: 56,634; makefile: 18,856; objc: 13,092; perl: 12,763; pascal: 5,960; yacc: 4,583; cs: 3,846; lex: 1,720; ruby: 1,002; php: 436; lisp: 258; awk: 105; sql: 66; sed: 53; csh: 10; exp: 6
file content (70 lines) | stat: -rw-r--r-- 2,459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
PRExplodedTime
==============

A clock/calendar representation of times.


Syntax
------

.. code::

    #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;
        PRTimeParameters tm_params;
    } PRExplodedTime;


Description
-----------

The :ref:`PRExplodedTime` structure represents clock/calendar time.
:ref:`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,
:ref:`PRExplodedTime` includes a :ref:`PRTimeParameters` structure
representing the local time zone information, so that the time point is
non-ambiguously specified.

The essential members of :ref:`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 `PRTimeParameters` structure representing the
   local time zone information.

The nonessential members of :ref:`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
:ref:`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 :ref:`PRExplodedTime` object or sets a
:ref:`PRExplodedTime` object as output, all of the :ref:`PRExplodedTime`
members are set, including the nonessential members. You can also use
``PR_NormalizeTime()`` to calculate the values of the nonessential
members.