On this page
time.h
Prev: math.h | Up: stdlib | Next: stdarg.h
Rel: math, time & assert Guide, c/builtins
Ref: cppreference — <time.h>
Tags: #public #prog #c #stdlib #time #index
Include
#include <time.h>
Overview
Wall-clock timestamps, calendar formatting, and CPU time measurement.
Core (#tier/core)
- time — Returns current calendar time in seconds since the Unix epoch.
- strftime — Formats a broken-down
struct tmintobufsafely with bounds checking.
Standard (#tier/standard)
- timespec_get — Populates
struct timespecwith nanosecond resolution (C11TIME_UTC). - gmtime — Converts
time_tto UTC broken-downstruct tm.
Legacy / Avoid (#tier/legacy)
- asctime — Formats time into a fixed non-thread-safe static buffer. Prefer strftime().
Linked from
Related notes
- tuts/c/stdlib Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/math Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/stdarg Linked here; links to this page; shared tags: #c, #index, #prog, #stdlib
- tuts/c/stdlib/time/asctime Linked here; links to this page; shared tags: #c, #prog, #stdlib, #time
- tuts/c/stdlib/time/gmtime Linked here; links to this page; shared tags: #c, #prog, #stdlib, #time
- tuts/c/stdlib/time/strftime Linked here; links to this page; shared tags: #c, #prog, #stdlib, #time
- tuts/c/stdlib/time/time Linked here; links to this page; shared tags: #c, #prog, #stdlib, #time
- tuts/c/stdlib/time/timespec_get Linked here; links to this page; shared tags: #c, #prog, #stdlib, #time
- tuts/c/builtins Linked here; shared tags: #c, #index, #prog
- tuts/c/stdlib/math/isnan links to this page; shared tags: #c, #prog, #stdlib