Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/chrono/c/ctime"

From cppreference.com
< cpp‎ | chrono‎ | c
Line 1: Line 1:
{{cpp/title| asctime}}
+
{{cpp/title| ctime}}
 
{{cpp/chrono/c/sidebar}}
 
{{cpp/chrono/c/sidebar}}
 
{{ddcl | header=ctime |
 
{{ddcl | header=ctime |
Line 16: Line 16:
 
*{{tt|ss}} - seconds  
 
*{{tt|ss}} - seconds  
 
*{{tt|yyyy}} - years
 
*{{tt|yyyy}} - years
 +
 +
The function does not support localization.
  
 
<!-- ======== -->
 
<!-- ======== -->

Revision as of 12:27, 14 June 2011

Template:cpp/chrono/c/sidebar

Defined in header <ctime>
char *ctime( const time_t *time );

Converts given time since epoch to a calendar local time and then to a textual representation. The resulting string has the following format:

Www Mmm dd hh:mm:ss yyyy
  • Www - the day of the week (one of Mon, Tue, Wed, Thu, Fri, Sat, Sun).
  • Mmm - the month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
  • dd - the day of the month
  • hh - hours
  • mm - minutes
  • ss - seconds
  • yyyy - years

The function does not support localization.

Template:params

time - pointer to a time_t object specifying the time to print

Template:returns

pointer to a static character string. The string is shared among ctime() and asctime() and is overwritten on each invocation.

Template:example cpp

Template:see also

Template:cpp/chrono/c/dcl list asctime