_strdate, _wstrdate

提供: RAD Studio
移動先: 案内検索

time.h:インデックス への移動


ヘッダーファイル

time.h

カテゴリ

変換ルーチン,日付/時刻ルーチン

プロトタイプ

char *_strdate(char *buf);

wchar_t *_wstrdate(wchar_t *buf);

説明

現在の日付を文字列に変換します。

_strdate は,現在の日付を文字列に変換し,それをバッファ buf に格納します。バッファは 9 文字以上である必要があります。

文字列は MM/DD/YY の形式です。MM,DD,YY は,それぞれ月,日,年を 2 桁の数字で表します。文字列はヌル文字で終了します。

戻り値

_strdate は,buf(日付文字列のアドレス)を返します。



 #include <time.h>
 #include <stdio.h>
 void main(void)
 {
   char datebuf[9];
   char timebuf[9];
   _strdate(datebuf);
   _strtime(timebuf);
   printf("Date: %s  Time: %s\n",datebuf,timebuf);
 }



移植性



POSIX Win32 ANSI C ANSI C++

strdate

+

_wstrdate

+