Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:35

0001 #ifndef DATE_TIME_LOCAL_TIME_CONVERSION_HPP__
0002 #define DATE_TIME_LOCAL_TIME_CONVERSION_HPP__
0003 
0004 /* Copyright (c) 2003-2004 CrystalClear Software, Inc.
0005  * Subject to the Boost Software License, Version 1.0.
0006  * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
0007  * Author: Jeff Garland, Bart Garst
0008  * $Date$
0009  */
0010 
0011 
0012 #include "boost/date_time/posix_time/conversion.hpp"
0013 #include "boost/date_time/c_time.hpp"
0014 #include "boost/date_time/local_time/local_date_time.hpp"
0015 
0016 namespace boost {
0017 namespace local_time {
0018 
0019 //! Function that creates a tm struct from a local_date_time
0020 inline
0021 std::tm to_tm(const local_date_time& lt) {
0022   std::tm lt_tm = posix_time::to_tm(lt.local_time());
0023   if(lt.is_dst()){
0024     lt_tm.tm_isdst = 1;
0025   }
0026   else{
0027     lt_tm.tm_isdst = 0;
0028   }
0029   return lt_tm;
0030 }
0031 
0032 
0033 }} // namespaces
0034 #endif // DATE_TIME_LOCAL_TIME_CONVERSION_HPP__