Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Minimize Date and Time Display Drudgery

Applications that display time and date often use tedious manual string formatting operations, making customization an ornery task. The problem is further aggravated when your app undergoes internationalization and localization. Find out how <ctime>'s strftime() function eases your time and date formatting pain.


advertisement
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 function strftime(), you can eliminate much of this drudgery—at 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.





Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap