File: prtimeparameters.rst

package info (click to toggle)
firefox-esr 115.14.0esr-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,659,200 kB
  • sloc: cpp: 6,676,648; javascript: 5,690,850; ansic: 3,328,545; python: 1,120,605; asm: 397,163; xml: 180,531; java: 178,838; sh: 68,930; makefile: 20,999; perl: 12,595; objc: 12,561; yacc: 4,583; cs: 3,846; pascal: 2,840; lex: 1,720; ruby: 1,079; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (54 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download | duplicates (17)
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
PRTimeParameters
================

A representation of time zone information.


Syntax
------

.. code::

    #include <prtime.h>

    typedef struct PRTimeParameters {
        PRInt32 tp_gmt_offset;
        PRInt32 tp_dst_offset;
    } PRTimeParameters;


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

Each geographic location has a standard time zone, and if Daylight
Saving Time (DST) is practiced, a daylight time zone. The
:ref:`PRTimeParameters` structure represents the local time zone
information in terms of the offset (in seconds) from GMT. The overall
offset is broken into two components:

``tp_gmt_offset``
   The offset of the local standard time from GMT.

``tp_dst_offset``
   If daylight savings time (DST) is in effect, the DST adjustment from
   the local standard time. This is most commonly 1 hour, but may also
   be 30 minutes or some other amount. If DST is not in effect, the
   tp_dst_offset component is 0.

For example, the US Pacific Time Zone has both a standard time zone
(Pacific Standard Time, or PST) and a daylight time zone (Pacific
Daylight Time, or PDT).

-  In PST, the local time is 8 hours behind GMT, so ``tp_gmt_offset`` is
   -28800 seconds. ``tp_dst_offset`` is 0, indicating that daylight
   saving time is not in effect.

-  In PDT, the clock is turned forward by one hour, so the local time is
   7 hours behind GMT. This is broken down as -8 + 1 hours, so
   ``tp_gmt_offset`` is -28800 seconds, and ``tp_dst_offset`` is 3600
   seconds.

A second example is Japan, which is 9 hours ahead of GMT. Japan does not
use daylight saving time, so the only time zone is Japan Standard Time
(JST). In JST ``tp_gmt_offset`` is 32400 seconds, and ``tp_dst_offset``
is 0.