OSDN Git Service

(split) Fixed #25191 (typo in fenv.3).
[linuxjm/LDP_man-pages.git] / release / man3 / timegm.3
1 .\" Copyright (C) 2001 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
24 .\" Translated Thu 3 Jan 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
25 .\"
26 .TH TIMEGM 3 2007-07-26 "GNU" "Linux Programmer's Manual"
27 .SH Ì¾Á°
28 timegm, timelocal \- gmtime ¤È localtime ¤ÎµÕ´Ø¿ô
29 .SH ½ñ¼°
30 .nf
31 .B #include <time.h>
32 .sp
33 .BI "time_t timelocal(struct tm *" tm );
34 .sp
35 .BI "time_t timegm(struct tm *" tm );
36 .sp
37 .fi
38 .in -4n
39 glibc ¸þ¤±¤Îµ¡Ç½¸¡ºº¥Þ¥¯¥í¤ÎÍ×·ï
40 .RB ( feature_test_macros (7)
41 »²¾È):
42 .in
43 .sp
44 .BR timelocal (),
45 .BR timegm ():
46 _BSD_SOURCE || _SVID_SOURCE
47 .SH ÀâÌÀ
48 .BR timelocal ()
49 ´Ø¿ô¤È
50 .BR timegm ()
51 ´Ø¿ô¤Ï¡¢¤½¤ì¤¾¤ì
52 .BR localtime (3)
53 ´Ø¿ô¤È
54 .BR gmtime (3)
55 ´Ø¿ô¤ÎµÕ´Ø¿ô¤Ç¤¢¤ë¡£
56 .SH ½àµò
57 ¤³¤ì¤é¤Î´Ø¿ô¤ÏÈóɸ½à¤Ç GNU ¤Î³ÈÄ¥¤Ç¤¢¤ë¡£
58 BSD ·Ï¤Ë¤â¸ºß¤¹¤ë¡£
59 ¤³¤ì¤é¤Î»ÈÍѤÏÈò¤±¤ë¤³¤È¡£¡ÖÃí°Õ¡×»²¾È¡£
60 .SH Ãí°Õ
61 .BR timelocal ()
62 ´Ø¿ô¤Ï POSIX ¤Îɸ½à´Ø¿ô
63 .BR mktime (3)
64 ¤ÈƱ¤¸¤â¤Î¤Ç¤¢¤ë¡£
65 ¤Î¤Ç¡¢¤³¤ì¤ò»È¤¦Íýͳ¤Ï¤Ê¤¤¤Ï¤º¤Ç¤¢¤ë¡£
66 .LP
67 .BR timegm ()
68 ¤ò°Ü¿¢À­¤¬¤¢¤ë¤è¤¦¤Ê¤«¤¿¤Á¤Ç¼Â¸½¤¹¤ë¤Ë¤Ï¡¢
69 .B TZ
70 ´Ä¶­ÊÑ¿ô¤ò UTC ¤ËÀßÄꤷ¤Æ¤«¤é
71 .BR mktime (3)
72 ¤ò¸Æ¤ó¤Ç¡¢
73 .B TZ
74 ¤ÎÃͤò¼èÆÀ¤¹¤ì¤Ð¤è¤¤¡£
75 Î㤨¤Ð¼¡¤Î¤è¤¦¤Ë¤Ê¤ë¤À¤í¤¦¡£
76 .sp
77 .in +4n
78 .nf
79 #include <time.h>
80 #include <stdlib.h>
81
82 time_t my_timegm (struct tm *tm)
83 {
84     time_t ret;
85     char *tz;
86
87     tz = getenv("TZ");
88     setenv("TZ", "", 1);
89     tzset();
90     ret = mktime(tm);
91     if (tz)
92         setenv("TZ", tz, 1);
93     else
94         unsetenv("TZ");
95     tzset();
96     return ret;
97 }
98 .fi
99 .in
100 .SH ´ØÏ¢¹àÌÜ
101 .BR gmtime (3),
102 .BR localtime (3),
103 .BR mktime (3),
104 .BR tzset (3)