Boost logo

Boost Users :

From: Bart (bartmann.nsd_at_[hidden])
Date: 2005-09-16 18:36:12


"Michal Lijowski" <michal_at_[hidden]> wrote in message
news:1126883517.24859.2.camel_at_ml-cvu.wustl.edu...
>I just started with date_time library using boost-1.33.0-3 on FC4 and
> gcc 4.0.1 20050727.
>
> It is rpm version downloaded from
> http://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS.
>
> I copied some lines of code from boost_date_time.pdf to get familiar
> with capabilities of this library and I encountered some problems.
>
> Here is a modified code taken from page 3 of the manual

...snip...

>
> My question is why d and t0 are not-a-date-time?
> Is this expected?
>

Yes, this is expected. The default constructors for date & ptime initialize
to not_a_date_time.

> Also the line
>
> ptime t1(d3, hours(5)+nanosec(100)); //date + time of day offset
>
> compiles with error: 'nanosec' was not declared in this scope
>

date_time can be compiled with either microsecond resolution or nanosecond
resolution. If microsecond resolution (the default) was used, the nanosec
code won't be available.

To enable nanosecond resolution, simply define
BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG.

Bart


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net