Boost logo

Boost :

From: Jeff Garland (jeff_at_[hidden])
Date: 2004-09-28 00:09:23

On Mon, 27 Sep 2004 13:12:20 +0000 (UTC), Martin wrote
> I'm trying to understand the date_time formatting via iostreams but
> got problems with a few things. I tried to search the archive but
> didn't find answers to these questions.
> 1. Why doesn't date_time use the standard time facet
> (time_put.do_put etc) if the special greg_date_facet isn't available?

Couple reasons. We have looked at using the current facets, and sadly, in our
testing we found most of the current facet implementations don't work
correctly -- so even if we did use them it wouldn't work. Second, the standard
facet doesn't cover all values that date_time offers such as infinities,
not-a-date-time, etc.

> 2. Why do I need to specify the names of all months and weekdays in
> the greg_date_facet just to use a different separator than '-' or
> another ordering?

Yes we realize this is a pain. The plan is to provide manipulators to control
these aspects so you don't have to mess with the facet to control seperators
and ordering.

> 3. How do I specify the format of a ptime (date-separator, time-
> separator and decimal separator)?

I'm afraid that's not settable at the moment -- the enhancement is still on
the todo list.

> --------------------------------------------
> I also got some compile warnings on VC70 (latest CVS)
> 1: in the function "from_time_t" on this line
> return start + seconds(t);
> boost\date_time\posix_time\conversion.hpp(27) warning C4244:
> 'argument' : conversion from 'time_t' to 'long', possible loss of data
> 2: in the function "from_stream_type"
> ss << ss.narrow(*beg++, 'X'); // 'X' will cause exception to be
> thrown
> boost\date_time\date_parsing.hpp(211): warning C4244: 'argument' :
> conversion from 'wchar_t' to 'char', possible loss of data

I'm still looking at this. We have a fix for the first one -- unsure on the
second one.


Boost list run by bdawes at, gregod at, cpdaniel at, john at