date_time: second_clock and microsec_clock errors

Good morning. I think I found small bug, but I am not sure. ( boost version is 1.33.1 beta ) Description: [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. Thanks Roman Yakovenko

On Mon, 28 Nov 2005 08:31:11 +0200, Roman Yakovenko wrote
Good morning. I think I found small bug, but I am not sure. ( boost version is 1.33.1 beta )
Description:
[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); If you want no adjustment from the machine, pass an empty shared ptr. Jeff
participants (2)
-
Jeff Garland
-
Roman Yakovenko