Boost logo

Boost :

From: Roman Yakovenko (roman.yakovenko_at_[hidden])
Date: 2005-11-28 08:20:47


> [mailto:boost-bounces_at_[hidden]]On Behalf Of Jeff Garland
> > [micro]second_clock< boost::local_time::local_date_time_base<> >
> > could not be compiled. The problematic function is: private: static
> > time_type create_time(::std::tm* current);
> >
> > The error is that local_date_time_base<> does not have constructors
> > that takes date and time duration.
>
> It's not really a problem. With local_time you need to
> provide a timezone
> pointer to get a time value. So you call it like this:
> //get time in new york time zone:
> boost::shared_ptr<time_zone> ny_tz(new
> posix_time_zone("EST-05EDT,M4.1.0,M10.5.0"));
>
> local_date_time ldt3 = local_microsec_clock::local_time(ny_tz);
>
>
> You'll note that there is another overloading in clock
> classes for this case:
>
> template<class time_zone_type>
> static time_type local_time(shared_ptr<time_zone_type> tz_ptr);

Yes, I discovered work around few days ago.
I posted the error here, because I think that this error indicates,
that something wrong with design.

I think that date_time library should define local_microsec_clock,
not in terms of microsec_clock, but using an other class that is
aware of time zone.

Why is microsec_clock class not aware of time zones?

> Jeff

Thanks

Roman Yakovenko


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk