tail head cat sleep
QR code linking to this page

manページ  — CFTIME

名称

cftime ascftime – 日付と時刻の文字列への変換

内容

ライブラリ

Compatibility Library (libcompat, -lcompat)

書式

#include <time.h>

int
cftime(char *s, char *format, const time_t *clock);

int
ascftime(char *s, const char *format, const struct tm *tmptr);

解説

cftime() 関数と ascftime() 関数は、 strftime(3) によって旧式なものとなっています。

関数 cftime() および ascftime() はできるだけ使用しないでください。 バッファのオーバフロー状態をチェックする方法がないからです。 代わりに strftime(3) を使用してください。

ascftime() は strftime(3) とほとんど同じです。ただし、最大バッファ長を指定するパラメータがないことと、 NULL ポインタが指定されると format パラメータがデフォルトで "" になるという点だけは異なります。

cftime() は同じ処理を行ないますが、指定された clock を変換するために最初に localtime(3) を起動してから、 format 引数で要求されているような変換を実行します。

戻り値

cftime() 関数と ascftime() 関数は、出力バッファ s に書き込まれた文字数を返します。その場合、末尾のヌル文字は数えません。

関連項目

localtime(3), strftime(3)

CFTIME (3) June 15, 1993

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

“ Some people open all the windows; wise wives welcome spring by moving the UNIX. ”