.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
.\" References consulted:
.\" Linux libc source code
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
-.TH STRFTIME 3 2010\-01\-17 GNU "Linux Programmer's Manual"
+.TH STRFTIME 3 2013\-06\-28 GNU "Linux Programmer's Manual"
.SH 名前
strftime \- 日付および時刻の文字列への変換
.SH 書式
\fI+hhmm\fP や \fI\-hhmm\fP の形式のタイムゾーン (UTC へのオフセット時間)。(SU)
.TP
\fB%Z\fP
-タイムゾーンまたはゾーン名または省略名。
+タイムゾーン名または省略名。
.TP
\fB%+\fP
.\" Nov 05 -- Not in Linux/glibc, but is in some BSDs (according to
.PP
要素別の時刻構造体 \fItm\fP の詳細は \fI<time.h>\fP に定義されている。 \fBctime\fP(3) も参照すること。
.SH 返り値
-\fBstrftime\fP() 関数は文字列 \fIs\fP に格納された文字数を返す。 この文字数に終端の NULL バイトは含まない。 終端の NULL
-バイトを格納できるだけの大きさを持った文字列を渡すこと。 それ以外の場合は 0 を返し、文字列の内容は修正されない。 (libc 4.4.4
-以降でこの挙動が適用されている。 libc 4.4.1 などの非常に古いバージョンの libc では 文字列が短か過ぎた場合には \fImax\fP
-が返される。)
+Provided that the result string, including the terminating null byte, does
+not exceed \fImax\fP bytes, \fBstrftime\fP() returns the number of bytes
+(excluding the terminating null byte) placed in the array \fIs\fP. If the
+length of the result string (including the terminating null byte) would
+exceed \fImax\fP bytes, then \fBstrftime\fP() returns 0, and the contents of the
+array are undefined. (This behavior applies since at least libc 4.4.4; very
+old versions of libc, such as libc 4.4.1, would return \fImax\fP if the array
+was too small.)
.LP
-返り値 0 は必ずしもエラーを意味している訳ではないので注意すること。 例えば、多くのロケールでは \fB%p\fP は空文字列を返す。
+返り値 0 は必ずしもエラーを意味している訳ではないので注意すること。 例えば、多くのロケールでは \fB%p\fP は空文字列を返す。 同様に、空の
+\fIformat\fP 文字列は空文字列を返す。
.SH 環境変数
環境変数 \fBTZ\fP と \fBLC_TIME\fP が使用される。 (訳注: \fBLC_ALL\fP が設定されている場合には \fBLC_TIME\fP
よりもそちらが優先される。 \fBLC_TIME\fP も \fBLC_ALL\fP も設定されていない場合には \fBLANG\fP が使用される。)
考慮してのものである (実際には、このような状況はこれまで一度も 起こっていない)。
.SH 注意
.SS "ISO\ 8601 の週・曜日表記 (Week Dates)"
-\fB%G\fP, \fB%g\fP, \fB%V\fP は、ISO\ 8601 標準により定義された週単位表記の年により 計算される値を出力する。 ISO\ 8601
-標準の週単位表記では、週は月曜日から開始され、 週番号は、年の最初の週が 01 となり、最後の週は 52 か 53 となる。 週 01 は、新しい年が
-4 日以上含まれる最初の週である。 言い換えると、週 01 は、その年の木曜日を含む最初の週、 つまり 1 月 4 日を含む週ということである。
-新しい年のカレンダー上の最初の週に新しい年が 3 日以下しか含まれない場合、 ISO\ 8601 の週単位表記では、これらの日を前の年の週 53
-の一部とみなす。 例えば、2010 年 1 月 1 日は金曜日であり、 その週には 2010 年の日が 3 日しか含まれない。 したがって、ISO\ 8601 の週単位表記では、これらの日は 2009 年 (\fB%G\fP) の週 53 (\fB%V\fP) の一部となる。 ISO\ 8601 の 2010
-年の週 01 は 2010 年 1 月 4 日の月曜日から始まる。
+\fB%G\fP, \fB%g\fP, and \fB%V\fP yield values calculated from the week\-based year
+defined by the ISO\ 8601 standard. In this system, weeks start on a Monday,
+and are numbered from 01, for the first week, up to 52 or 53, for the last
+week. Week 1 is the first week where four or more days fall within the new
+year (or, synonymously, week 01 is: the first week of the year that contains
+a Thursday; or, the week that has 4 January in it). When three of fewer
+days of the first calendar week of the new year fall within that year, then
+the ISO 8601 week\-based system counts those days as part of week 53 of the
+preceding year. For example, 1 January 2010 is a Friday, meaning that just
+three days of that calendar week fall in 2010. Thus, the ISO\ 8601
+week\-based system considers these days to be part of week 53 (\fB%V\fP) of the
+year 2009 (\fB%G\fP); week 01 of ISO\ 8601 year 2010 starts on Monday, 4
+January 2010.
.SS "glibc での注意"
.\" HP-UX and Tru64 also have features like this.
glibc では変換指定にいくつか拡張を行っている (これらの拡張は POSIX.1\-2001 には規定されていないが、
オプションの10進数の幅指定子はフラグの後ろに置くことができる (フラグはなくてもよい)。フィールドの本来の大きさが指定された幅よりも
小さい場合、結果文字列の左側は指定された幅までパディングされる。
.SH バグ
+If the output string would exceed \fImax\fP bytes, \fIerrno\fP is \fInot\fP set.
+This makes it impossible to distinguish this error case from cases where the
+\fIformat\fP string legitimately produces a zero\-length output string.
+POSIX.1\-2001 does \fInot\fP specify any \fIerrno\fP settings for \fBstrftime\fP().
+
\fBgcc\fP(1) のいくつかのバージョンにはおかしなところがあり、 \fB%c\fP の使用法について以下のような警告を出す: \fIwarning:
`%c' yields only last 2 digits of year in some locales\fP
(\fI警告:\fPいくつかのロケールでは\fI`%c'\fPは年の下2桁しか出力しない\fI)。\fP もちろんプログラマが \fB%c\fP
.SH 関連項目
\fBdate\fP(1), \fBtime\fP(2), \fBctime\fP(3), \fBsetlocale\fP(3), \fBsprintf\fP(3),
\fBstrptime\fP(3)
+.SH この文書について
+この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.52 の一部
+である。プロジェクトの説明とバグ報告に関する情報は
+http://www.kernel.org/doc/man\-pages/ に書かれている。