We will begin this chapter by discussing POSIX time.h APIs, which provide APIs for reading various clocks and performing calculations on these clock times. Although these APIs are specific to standard C, as will be demonstrated in the following section, the C time interfaces are still needed when working with C++, a problem that is being addressed in C++20.
Learning about POSIX time.h APIs
Learning about the types of APIs
The UNIX epoch defines the number of seconds from January 1, 1970. Interfaces described in this chapter leverage the UNIX epoch to define the notion of time. The POSIX time.h APIs, for the purpose of this chapter, define three different, opaque types:
- tm: An opaque structure that holds a date and time. ...