名前空間
変種
操作

std::asctime

提供: cppreference.com
< cpp‎ | chrono‎ | c

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
ペアとタプル
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
C形式の日付と時刻のユーティリティ
機能します
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
時間操作
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
フォーマット変換
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
定数
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
タイプ
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <ctime>
char* asctime( const std::tm* time_ptr );
与えられたカレンダー時刻std::tmは、テキスト形式に変換します.
Original:
Converts given calendar time std::tm to a textual representation.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
結果の文字列の形式は次のとおりです
Original:
The resulting string has the following format:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Www Mmm dd hh:mm:ss yyyy
  • Www - 曜日(Monの一つ、TueWedThuFriSatSun).
    Original:
    Www - the day of the week (one of Mon, Tue, Wed, Thu, Fri, Sat, Sun).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Mmm - 月(Janの一つ、FebMarAprMayJunJulAugSepOctNovDec).
    Original:
    Mmm - the month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • dd - 月の日
    Original:
    dd - the day of the month
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • hh - 時間
    Original:
    hh - hours
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • mm - 分
    Original:
    mm - minutes
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ss - 秒
    Original:
    ss - seconds
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • yyyy - 年
    Original:
    yyyy - years
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
この関数は、ローカリゼーションをサポートしていません.
Original:
The function does not support localization.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

time_ptr -
印刷する時間を指定してstd::tmオブジェクトへのポインタを返します
Original:
pointer to a std::tm object specifying the time to print
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

日付と時刻のテキスト表現を保持する静的ヌル終端の文字列へのポインタ。文字列はstd::asctimestd::ctime間で共有することができ、これらの機能のいずれかを呼び出すたびに上書きされる可能性があります.
Original:
Pointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between std::asctime and std::ctime, and may be overwritten on each invocation of any of those functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] ノート

この関数は、静的データへのポインタを返し、スレッドセーフではありません。 POSIXでは、この関数は廃止されたとマークして、代わりにstd::strftimeお勧め.
Original:
This function returns a pointer to static data and is not thread-safe. POSIX marks this function obsolete and recommends std::strftime instead.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
timeptr->tm_wday、またはtimeptr->tm_mon予想の範囲内でない場合、またはtimeptr->tm_yearINT_MAX-1990を超えた場合、出力文字列は、25文字より長くなる場合の動作は未定義です.
Original:
The behavior is undefined if the output string would be longer than 25 characters, if timeptr->tm_wday or timeptr->tm_mon are not within the expected ranges, or if timeptr->tm_year exceeds INT_MAX-1990.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
一部の実装では、前月の最後の日を意味するものとしてtimeptr->tm_mday==0を処理.
Original:
Some implementations handle timeptr->tm_mday==0 as meaning the last day of the preceding month.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集]

#include <ctime>
#include <iostream>
 
int main()
{
    std::time_t result = std::time(NULL);
    std::cout << std::asctime(std::localtime(&result));
}

Output:

Tue Dec 27 16:45:52 2011

[編集] も参照してください

テキスト表現にtime_tオブジェクトを変換します
Original:
converts a time_t object to a textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数) [edit]
カスタムテキスト表現にtmオブジェクトを変換します
Original:
converts a tm object to custom textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数) [edit]
(C++11)
フォーマットと指定された書式に従って日付/時刻の値を出力します
Original:
formats and outputs a date/time value according to the specified format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
C documentation for asctime