Re: [Cppcms-users] boost.locale and date formatting
Brought to you by:
artyom-beilis
From: Artyom <art...@ya...> - 2011-05-04 07:35:44
|
> From: augustin <aug...@ov...> > > (second try to send this to the list) > > Hello, > > Speaking of boost(er).locale, I am having problems formatting dates. > > I tried the simple example from here: > [...] See: http://thread.gmane.org/gmane.comp.lib.boost.devel/218008 > I'm sure I am missing something simple. > Probably, I need to set the locale first, but it's not clear to me how to do > it. See section about locale generation. > > Also, a grip I have with most/all boost libraries, is that one never knows > what option to pass to the linker: > http://stackoverflow.com/questions/3467153/is-there-an-intelligent-way-to-know- > the-name-of-the-library-to-link-to-at-compile > Is this platform/compiler dependent? Can't this kind of thing be documented? > Anyway, in this case, I found it was -lboost_locale. > This is something Boost general not related to Boost.Locale specifically. > For boost.locale, more, fully working, compilable examples would help. > Take a look on libs/locale/examples with full code to see what you miss. > - > > Most boost libraries documentation are written for very experienced C++ > developers. From a newbie perspective, I find most documentation very obtuse. >I > > checked boost.date_time for a long while, and still couldn't understand >enough > > to actually make use of it. I still have much to learn before I can understand > > a lot of the boost documentation. > > - This specific "problem" would be added to FAQ. > > Generally speaking, within the context of a cppcms application, what is the > best/recommended way to format dates, times and such? > Basically, I have a unix timestamp, and I want to output it in human readable > form, both in the UTC and locale timezone. > Read the tutorial there are an examples how to make UTC, local timezone (default) or custom time zone output (there is a manipulator for this purpose and formatting flags). Also the way you want to display dates is application specific and dependent on use case. Best, Artyom |