ctime
来自cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <time.h>
|
||
将已给定的时间,因为时代的日历本地时间,然后到一个文本表示,如果通过调用asctime(localtime(time))。得到的字符串具有以下格式:
Original:
Converts given time since epoch to a calendar local time and then to a textual representation, as if by calling asctime(localtime(time)). 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.
You can help to correct and verify the translation. Click here for instructions.
Www Mmm dd hh:mm:ss yyyy
Www- 星期几(之一Mon,Tue,Wed,Thu,Fri,Sat,Sun).Original:Www- the day of the week (one ofMon,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,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec).Original:Mmm- the month (one ofJan,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 monthThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.hh- 小时Original:hh- hoursThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.mm- 分钟Original:mm- minutesThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.ss- 秒Original:ss- secondsThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.yyyy- 年Original:yyyy- yearsThe 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.
You can help to correct and verify the translation. Click here for instructions.
目录 |
[编辑] 参数
| time | - | 指定的时间打印到time_t对象的指针
Original: pointer to a time_t 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. |
[编辑] 返回值
指针指向一个静态的空字符结尾的字符串的文字表示的日期和时间。
asctime和ctime之间的字符串可以共享,并在每次调用时可能会被覆盖的任何职能.Original:
pointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between
asctime and 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.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 注释
这个函数返回一个指向静态数据的指针,是不是线程安全的。此外,它可共享与tm和gmtime修改静态localtime对象。 POSIX标志着这个功能已经过时,并建议strftime,而不是.
Original:
This function returns a pointer to static data and is not thread-safe. In addition, it modifies the static tm object which may be shared with gmtime and localtime. POSIX marks this function obsolete and recommends strftime instead.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
此行为可能是未定义的time_t的值,结果在超过25个字符的字符串(例如,一年10000)
Original:
The behavior may be undefined for the values of time_t that result in the string longer than 25 characters (e.g. year 10000)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[编辑] 为例
| 本节是不完整的 原因: no example |
[编辑] 另请参阅
| 一个 time_t对象转换为文本表示Original: converts a time_t object to a textual representationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
tm对象转换成自定义的文字表述Original: converts a tm object to custom textual representationThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (函数) | |
| C++ documentation for ctime
| |