Namespaces
Variants
Views
Actions

Difference between revisions of "c/chrono/localtime"

From cppreference.com
< c‎ | chrono
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh)
m (Shorten template names. Use {{lc}} where appropriate.)
Line 8: Line 8:
  
 
===Parameters===
 
===Parameters===
{{param list begin}}
+
{{par begin}}
{{param list item | time | pointer to a {{tt|time_t}} object to convert}}
+
{{par | time | pointer to a {{tt|time_t}} object to convert}}
{{param list end}}
+
{{par end}}
  
 
===Return value===
 
===Return value===
  
pointer to a static internal {{c|tm}} object on success, or {{c|NULL}} otherwise. The structure may be shared between {{c|gmtime}}, {{c|localtime}}, and {{c|ctime}}, and may be overwritten on each invocation.
+
pointer to a static internal {{c|tm}} object on success, or {{lc|NULL}} otherwise. The structure may be shared between {{c|gmtime}}, {{c|localtime}}, and {{c|ctime}}, and may be overwritten on each invocation.
  
 
===Notes===
 
===Notes===
 
This function may not be thread-safe.
 
This function may not be thread-safe.
  
POSIX requires that this function sets {{c|errno}} to {{c|EOVERFLOW}} if it fails because the argument is too large.
+
POSIX requires that this function sets {{lc|errno}} to {{lc|EOVERFLOW}} if it fails because the argument is too large.
  
 
===Example===
 
===Example===
Line 29: Line 29:
  
 
===See also===
 
===See also===
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list template | c/chrono/dcl list gmtime}}
+
{{dsc inc | c/chrono/dcl list gmtime}}
{{dcl list see cpp | cpp/chrono/c/localtime}}
+
{{dsc see cpp | cpp/chrono/c/localtime}}
{{dcl list end}}
+
{{dsc end}}
  
 
[[de:c/chrono/localtime]]
 
[[de:c/chrono/localtime]]

Revision as of 17:28, 31 May 2013

Defined in header <time.h>
tm* localtime( const time_t *time );

Converts given time since epoch as time_t value into calendar time, expressed in local time.

Contents

Parameters

time - pointer to a time_t object to convert

Return value

pointer to a static internal tm object on success, or NULL otherwise. The structure may be shared between gmtime, localtime, and ctime, and may be overwritten on each invocation.

Notes

This function may not be thread-safe.

POSIX requires that this function sets errno to EOVERFLOW if it fails because the argument is too large.

Example

See also

Template:c/chrono/dcl list gmtime
C++ documentation for localtime