Re: [Cppcms-users] How to store/manipulate dates?
Brought to you by:
artyom-beilis
From: Marcel H. <ke...@co...> - 2012-02-06 08:05:30
|
hmm. I don't actually know what do you want. You have a database with some some unix timestamps in it, right? Next thing you want to do is to covert them into a human readable format? Read the doc from the date_time class. Maybe in fact that is what you are really looking for. Maybe you combine both, DateTime and ptime. http://cppcms.com/cppcms_ref_v0_99/classbooster_1_1locale_1_1calendar__facet.html http://cppcms.com/cppcms_ref_v0_99/group__date__time.html There is also a note when he throws an exception. Maybe you look into the messageboard example. I think there is what you want. Also i don't know what do you mean with "storing only date" I think what you want is to make it const. Or you define a class and make it private with a "getter" (: Happy trying. ele...@ex... schrieb: Ah yes, thank you. This is what im doing now - c.topics[i].created_at = booster::ptime::local_time(r.get<std::tm>("created_at")); Next question is - what data type to use for storing only date? Thanks again Petr > Sorry for the "late" reply. > What you are looking for is this > > http://cppcms.com/cppcms_ref_v0_99/classbooster_1_1ptime.html > > greetings > _____________________________________________ Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 _____________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |