| 1 |
.\" Copyright 2020, Michael Kerrisk <[email protected]> |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 5 |
.\" |
| 6 |
.TH time_t 3type 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
time_t, suseconds_t, useconds_t \- integer time |
| 9 |
.SH LIBRARY |
| 10 |
Standard C library |
| 11 |
.RI ( libc ) |
| 12 |
.SH SYNOPSIS |
| 13 |
.nf |
| 14 |
.B #include <time.h> |
| 15 |
.P |
| 16 |
.BR typedef " /* ... */ " time_t; |
| 17 |
.P |
| 18 |
.B #include <sys/types.h> |
| 19 |
.P |
| 20 |
.BR typedef " /* ... */ " suseconds_t; |
| 21 |
.BR typedef " /* ... */ " useconds_t; |
| 22 |
.fi |
| 23 |
.SH DESCRIPTION |
| 24 |
.TP |
| 25 |
.I time_t |
| 26 |
Used for time in seconds. |
| 27 |
According to POSIX, |
| 28 |
it is an integer type |
| 29 |
of at least 64 bits. |
| 30 |
.TP |
| 31 |
.I suseconds_t |
| 32 |
Used for time in microseconds. |
| 33 |
It is a signed integer type |
| 34 |
capable of storing values at least in the range |
| 35 |
.RB [ \-1 , |
| 36 |
.BR 1000000 ]. |
| 37 |
.TP |
| 38 |
.I useconds_t |
| 39 |
Used for time in microseconds. |
| 40 |
It is an unsigned integer type |
| 41 |
capable of storing values at least in the range |
| 42 |
.RB [ 0 , |
| 43 |
.BR 1000000 ]. |
| 44 |
.SH STANDARDS |
| 45 |
.TP |
| 46 |
.I time_t |
| 47 |
C11, POSIX.1-2024. |
| 48 |
.TP |
| 49 |
.I suseconds_t |
| 50 |
POSIX.1-2024. |
| 51 |
.TP |
| 52 |
.I useconds_t |
| 53 |
None. |
| 54 |
.SH HISTORY |
| 55 |
.TP |
| 56 |
.I time_t |
| 57 |
C89, |
| 58 |
POSIX.1-1988. |
| 59 |
.TP |
| 60 |
.I suseconds_t |
| 61 |
SUSv2, |
| 62 |
POSIX.1-2001 XSI, |
| 63 |
POSIX.1-2024. |
| 64 |
.TP |
| 65 |
.I useconds_t |
| 66 |
SUSv1, |
| 67 |
POSIX.1-2001 XSI. |
| 68 |
Removed in POSIX.1-2008. |
| 69 |
.SS Header files |
| 70 |
.I <sched.h> |
| 71 |
defines |
| 72 |
.I time_t |
| 73 |
since POSIX.1-2008. |
| 74 |
.SS time_t |
| 75 |
POSIX.1-2024 requires that the width of |
| 76 |
.I time_t |
| 77 |
is at least 64 bits; |
| 78 |
however, |
| 79 |
some systems still use 32 bits by default. |
| 80 |
.SH NOTES |
| 81 |
On some architectures, |
| 82 |
the width of |
| 83 |
.I time_t |
| 84 |
can be controlled with the feature test macro |
| 85 |
.BR _TIME_BITS . |
| 86 |
See |
| 87 |
.BR feature_test_macros (7). |
| 88 |
.P |
| 89 |
The following headers also provide |
| 90 |
.IR time_t : |
| 91 |
.IR <sched.h> , |
| 92 |
.IR <sys/msg.h> , |
| 93 |
.IR <sys/select.h> , |
| 94 |
.IR <sys/sem.h> , |
| 95 |
.IR <sys/shm.h> , |
| 96 |
.IR <sys/stat.h> , |
| 97 |
.IR <sys/time.h> , |
| 98 |
.IR <sys/types.h> , |
| 99 |
and |
| 100 |
.IR <utime.h> . |
| 101 |
.P |
| 102 |
The following headers also provide |
| 103 |
.IR suseconds_t : |
| 104 |
.I <sys/select.h> |
| 105 |
and |
| 106 |
.IR <sys/time.h> . |
| 107 |
.P |
| 108 |
The following headers also provided |
| 109 |
.IR useconds_t : |
| 110 |
.IR <unistd.h> . |
| 111 |
.SH SEE ALSO |
| 112 |
.BR stime (2), |
| 113 |
.BR time (2), |
| 114 |
.BR ctime (3), |
| 115 |
.BR difftime (3), |
| 116 |
.BR usleep (3), |
| 117 |
.BR timeval (3type) |