source: NonGTP/Boost/boost/date_time/local_time/conversion.hpp @ 857

Revision 857, 911 bytes checked in by igarcia, 19 years ago (diff)
Line 
1#ifndef DATE_TIME_LOCAL_TIME_CONVERSION_HPP__
2#define DATE_TIME_LOCAL_TIME_CONVERSION_HPP__
3
4/* Copyright (c) 2003-2004 CrystalClear Software, Inc.
5 * Subject to the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
7 * Author: Jeff Garland, Bart Garst
8 * $Date: 2004/10/07 22:28:21 $
9 */
10
11
12#include "boost/date_time/posix_time/conversion.hpp"
13#include "boost/date_time/c_time.hpp"
14#include "boost/date_time/local_time/local_date_time.hpp"
15
16namespace boost {
17namespace local_time {
18
19//! Function that creates a tm struct from a local_date_time
20inline
21tm to_tm(const local_date_time& lt) {
22  tm lt_tm;
23  lt_tm = posix_time::to_tm(lt.local_time());
24  if(lt.is_dst()){
25    lt_tm.tm_isdst = 1;
26  }
27  else{
28    lt_tm.tm_isdst = 0;
29  }
30  return lt_tm;
31}
32
33
34}} // namespaces
35#endif // DATE_TIME_LOCAL_TIME_CONVERSION_HPP__
Note: See TracBrowser for help on using the repository browser.