blob: 0129335a514a5e8749208fadff6cc3f591400022 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/*
* localtime.c
*/
/*
FUNCTION
<<localtime>>---convert time to local representation
INDEX
localtime
INDEX
localtime_r
SYNOPSIS
#include <time.h>
struct tm *localtime(time_t *<[clock]>);
struct tm *localtime_r(time_t *<[clock]>, struct tm *<[res]>);
DESCRIPTION
<<localtime>> converts the time at <[clock]> into local time, then
converts its representation from the arithmetic representation to the
traditional representation defined by <<struct tm>>.
<<localtime>> constructs the traditional time representation in static
storage; each call to <<gmtime>> or <<localtime>> will overwrite the
information generated by previous calls to either function.
<<mktime>> is the inverse of <<localtime>>.
RETURNS
A pointer to the traditional time representation (<<struct tm>>).
PORTABILITY
ANSI C requires <<localtime>>.
<<localtime>> requires no supporting OS subroutines.
*/
#include <stdlib.h>
#include <time.h>
#include <reent.h>
#ifndef _REENT_ONLY
struct tm *
_DEFUN (localtime, (tim_p),
_CONST time_t * tim_p)
{
struct _reent *reent = _REENT;
_REENT_CHECK_TM(reent);
return localtime_r (tim_p, (struct tm *)_REENT_TM(reent));
}
#endif
|