Chris@16: #ifndef DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ Chris@16: #define DATE_TIME_LOCAL_TIME_CONVERSION_HPP__ Chris@16: Chris@16: /* Copyright (c) 2003-2004 CrystalClear Software, Inc. Chris@16: * Subject to the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) Chris@16: * Author: Jeff Garland, Bart Garst Chris@101: * $Date$ Chris@16: */ Chris@16: Chris@16: Chris@16: #include "boost/date_time/posix_time/conversion.hpp" Chris@16: #include "boost/date_time/c_time.hpp" Chris@16: #include "boost/date_time/local_time/local_date_time.hpp" Chris@16: Chris@16: namespace boost { Chris@16: namespace local_time { Chris@16: Chris@16: //! Function that creates a tm struct from a local_date_time Chris@16: inline Chris@16: std::tm to_tm(const local_date_time& lt) { Chris@16: std::tm lt_tm = posix_time::to_tm(lt.local_time()); Chris@16: if(lt.is_dst()){ Chris@16: lt_tm.tm_isdst = 1; Chris@16: } Chris@16: else{ Chris@16: lt_tm.tm_isdst = 0; Chris@16: } Chris@16: return lt_tm; Chris@16: } Chris@16: Chris@16: Chris@16: }} // namespaces Chris@16: #endif // DATE_TIME_LOCAL_TIME_CONVERSION_HPP__