Difference between revisions of "c/chrono/ctime"
m (Text replace - "/sidebar" to "/navbar") |
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh) |
||
Line 46: | Line 46: | ||
{{dcl list see cpp | cpp/chrono/c/ctime}} | {{dcl list see cpp | cpp/chrono/c/ctime}} | ||
{{dcl list end}} | {{dcl list end}} | ||
+ | |||
+ | [[de:c/chrono/ctime]] | ||
+ | [[es:c/chrono/ctime]] | ||
+ | [[fr:c/chrono/ctime]] | ||
+ | [[it:c/chrono/ctime]] | ||
+ | [[ja:c/chrono/ctime]] | ||
+ | [[pt:c/chrono/ctime]] | ||
+ | [[ru:c/chrono/ctime]] | ||
+ | [[zh:c/chrono/ctime]] |
Revision as of 22:16, 2 November 2012
Defined in header <time.h>
|
||
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:
Www Mmm dd hh:mm:ss yyyy
Www
- the day of the week (one ofMon
,Tue
,Wed
,Thu
,Fri
,Sat
,Sun
).Mmm
- the month (one ofJan
,Feb
,Mar
,Apr
,May
,Jun
,Jul
,Aug
,Sep
,Oct
,Nov
,Dec
).dd
- the day of the monthhh
- hoursmm
- minutesss
- secondsyyyy
- years
The function does not support localization.
Contents |
Parameters
time | - | pointer to a time_t object specifying the time to print |
Return value
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.
Notes
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 behavior may be undefined for the values of time_t that result in the string longer than 25 characters (e.g. year 10000)
Example
This section is incomplete Reason: no example |
See also
C++ documentation for ctime
|