any moons ago, I presented C++'s basic <ctime> time and date facilities
. At that time, however, I didn't demonstrate how to format and customize the date and time. Such customizations may be needed when you localize an application, for example. Although internationalization and localization are notoriously complex, with some help from <ctime>'s
, you can eliminate much of this drudgeryat least as far as the time and date are concerned.
How do you format the date and time in an easy and portable manner?
Use the strftime() library function.