O'Reilly logo

Advanced UNIX Programming by Warren W. Gay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time Conversion Functions

All date and time functions in this section require the include file <time.h>. In the remainder of this chapter, the following conversions will be examined:

  • time_t values to ASCII date/time strings

  • time_t values to date/time components (second, minute, hour, day, month, year, and so on)

  • Date/time components to ASCII strings

  • Date/time components to time_t values

In addition to looking at the various conversion functions, a simple C++ class DTime will be built and illustrated. This object has been left as simple as possible to prevent obscuring the underlying functions being discussed. For this reason, the DTime class in its present form is not entirely suitable for use in production-mode programs. The include file and the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required