Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

10. Time > Time-Conversion Functions

Time-Conversion Functions

Figure 10-1 shows the functions used to convert between time_t values and other time formats, including printable representations. These functions shield us from the complexity brought to such conversions by timezones, daylight saving time (DST) regimes, and localization issues. (We describe timezones in Timezones and locales in Section 10.4.)

Functions for retrieving and working with calendar time
Figure 10-1. Functions for retrieving and working with calendar time

Converting time_t to Printable Form

The ctime() function provides a simple method of converting a time_t value into printable form.

#include <time.h>

char *ctime(const time_t *timep);

Note


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint