tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

prexplodedtime.rst (2489B)


      1 PRExplodedTime
      2 ==============
      3 
      4 A clock/calendar representation of times.
      5 
      6 
      7 Syntax
      8 ------
      9 
     10 .. code::
     11 
     12    #include <prtime.h>
     13 
     14    typedef struct PRExplodedTime {
     15        PRInt32 tm_usec;
     16        PRInt32 tm_sec;
     17        PRInt32 tm_min;
     18        PRInt32 tm_hour;
     19        PRInt32 tm_mday;
     20        PRInt32 tm_month;
     21        PRInt16 tm_year;
     22        PRInt8 tm_wday;
     23        PRInt16 tm_yday;
     24        PRTimeParameters tm_params;
     25    } PRExplodedTime;
     26 
     27 
     28 Description
     29 -----------
     30 
     31 The :ref:`PRExplodedTime` structure represents clock/calendar time.
     32 :ref:`PRExplodedTime` has the familiar time components: year, month, day of
     33 month, hour, minute, second. It also has a microsecond component, as
     34 well as the day of week and the day of year. In addition,
     35 :ref:`PRExplodedTime` includes a :ref:`PRTimeParameters` structure
     36 representing the local time zone information, so that the time point is
     37 non-ambiguously specified.
     38 
     39 The essential members of :ref:`PRExplodedTime` are:
     40 
     41 - :ref:`tm_year`: absolute year, AD (by "absolute," we mean if the year is
     42   2000, this field's value is 2000).
     43 - :ref:`tm_month`: number of months past tm_year. The range is [0, 11]. 0
     44   is January and 11 is December.
     45 - :ref:`tm_mday`: the day of month. The range is [1, 31]. Note that it
     46   starts from 1 as opposed to 0.
     47 - :ref:`tm_hour`: number of hours past tm_mday. The range is [0, 23].
     48 - :ref:`tm_min`: number of minutes past tm_hour. The range is [0, 59].
     49 - :ref:`tm_sec`: number of seconds past tm_min. The range is [0, 61]. The
     50   values 60 and 61 are for accommodating up to two leap seconds.
     51 - :ref:`tm_usec`: number of microseconds past tm_sec. The range is [0,
     52   999999].
     53 - :ref:`tm_params`: a `PRTimeParameters` structure representing the
     54   local time zone information.
     55 
     56 The nonessential members of :ref:`PRExplodedTime` are:
     57 
     58 - :ref:`tm_wday`: day of week. The range is [0, 6]. 0 is Sunday, 1 is
     59   Monday, and 6 is Saturday.
     60 - :ref:`tm_yday`: day of year. The range is [0, 365]. 0 is the 1st of
     61   January.
     62 
     63 On input to NSPR functions, only the essential members of
     64 :ref:`PRExplodedTime` must be specified. The two nonessential members (day
     65 of week and day of year) are ignored by NSPR functions as input. When an
     66 NSPR function returns a :ref:`PRExplodedTime` object or sets a
     67 :ref:`PRExplodedTime` object as output, all of the :ref:`PRExplodedTime`
     68 members are set, including the nonessential members. You can also use
     69 ``PR_NormalizeTime()`` to calculate the values of the nonessential
     70 members.