/
usr
/
include
/
boost
/
date_time
/
/usr/include/boost/date_time
mkdir
upload
Name
Size
Mode
Actions
gregorian/
-
0755
rm
local_time/
-
0755
rm
posix_time/
-
0755
rm
adjust_functors.hpp
5467
0644
edit
dl
rm
compiler_config.hpp
5640
0644
edit
dl
rm
constrained_value.hpp
4224
0644
edit
dl
rm
c_local_time_adjustor.hpp
2631
0644
edit
dl
rm
c_time.hpp
4496
0644
edit
dl
rm
date.hpp
7357
0644
edit
dl
rm
date_clock_device.hpp
2299
0644
edit
dl
rm
date_defs.hpp
701
0644
edit
dl
rm
date_duration.hpp
4669
0644
edit
dl
rm
date_duration_types.hpp
9186
0644
edit
dl
rm
date_facet.hpp
29314
0644
edit
dl
rm
date_formatting.hpp
4208
0644
edit
dl
rm
date_formatting_limited.hpp
3461
0644
edit
dl
rm
date_formatting_locales.hpp
6748
0644
edit
dl
rm
date_format_simple.hpp
3128
0644
edit
dl
rm
date_generators.hpp
16508
0644
edit
dl
rm
date_generator_formatter.hpp
11715
0644
edit
dl
rm
date_generator_parser.hpp
13064
0644
edit
dl
rm
date_iterator.hpp
3305
0644
edit
dl
rm
date_names_put.hpp
10754
0644
edit
dl
rm
date_parsing.hpp
14146
0644
edit
dl
rm
dst_rules.hpp
15401
0644
edit
dl
rm
dst_transition_generators.hpp
2293
0644
edit
dl
rm
filetime_functions.hpp
3163
0644
edit
dl
rm
find_match.hpp
1355
0644
edit
dl
rm
format_date_parser.hpp
23909
0644
edit
dl
rm
gregorian_calendar.hpp
2714
0644
edit
dl
rm
gregorian_calendar.ipp
7947
0644
edit
dl
rm
int_adapter.hpp
14463
0644
edit
dl
rm
iso_format.hpp
5640
0644
edit
dl
rm
locale_config.hpp
1206
0644
edit
dl
rm
local_timezone_defs.hpp
7618
0644
edit
dl
rm
local_time_adjustor.hpp
8578
0644
edit
dl
rm
microsec_time_clock.hpp
6257
0644
edit
dl
rm
parse_format_base.hpp
961
0644
edit
dl
rm
period.hpp
11936
0644
edit
dl
rm
period_formatter.hpp
7237
0644
edit
dl
rm
period_parser.hpp
7932
0644
edit
dl
rm
special_defs.hpp
633
0644
edit
dl
rm
special_values_formatter.hpp
3657
0644
edit
dl
rm
special_values_parser.hpp
6161
0644
edit
dl
rm
strings_from_facet.hpp
4505
0644
edit
dl
rm
string_convert.hpp
1002
0644
edit
dl
rm
string_parse_tree.hpp
8405
0644
edit
dl
rm
time.hpp
6788
0644
edit
dl
rm
time_clock.hpp
2245
0644
edit
dl
rm
time_defs.hpp
942
0644
edit
dl
rm
time_duration.hpp
10569
0644
edit
dl
rm
time_facet.hpp
58988
0644
edit
dl
rm
time_formatting_streams.hpp
3752
0644
edit
dl
rm
time_iterator.hpp
1438
0644
edit
dl
rm
time_parsing.hpp
11846
0644
edit
dl
rm
time_resolution_traits.hpp
6760
0644
edit
dl
rm
time_system_counted.hpp
9051
0644
edit
dl
rm
time_system_split.hpp
8077
0644
edit
dl
rm
time_zone_base.hpp
3711
0644
edit
dl
rm
time_zone_names.hpp
3103
0644
edit
dl
rm
tz_db_base.hpp
15915
0644
edit
dl
rm
wrapping_int.hpp
5824
0644
edit
dl
rm
year_month_day.hpp
1375
0644
edit
dl
rm
Edit:
/usr/include/boost/date_time/local_timezone_defs.hpp
(7618B)
#ifndef DATE_TIME_LOCAL_TIMEZONE_DEFS_HPP__ #define DATE_TIME_LOCAL_TIMEZONE_DEFS_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland * $Date$ */ #include "boost/date_time/dst_rules.hpp" namespace boost { namespace date_time { // Configurations for common dst rules cases: // See http://www.wharton.co.uk/Support/sup_dst.htm for more // information on how various locales use dst rules //! Specification for daylight savings start rules in US /*! This class is used to configure dst_calc_engine template typically as follows: @code using namespace boost::gregorian; using namespace boost::posix_time; typedef us_dst_trait<date> us_dst_traits; typedef boost::date_time::dst_calc_engine<date, time_duration, us_dst_traits> us_dst_calc; //calculate the 2002 transition day of USA April 7 2002 date dst_start = us_dst_calc::local_dst_start_day(2002); //calculate the 2002 transition day of USA Oct 27 2002 date dst_end = us_dst_calc::local_dst_end_day(2002); //check if a local time is in dst or not -- posible answers //are yes, no, invalid time label, ambiguous ptime t(...some time...); if (us_dst::local_is_dst(t.date(), t.time_of_day()) == boost::date_time::is_not_in_dst) { } @endcode This generates a type suitable for the calculation of dst transitions for the United States. Of course other templates can be used for other locales. */ template<class date_type> struct us_dst_trait { typedef typename date_type::day_of_week_type day_of_week_type; typedef typename date_type::month_type month_type; typedef typename date_type::year_type year_type; typedef date_time::nth_kday_of_month<date_type> start_rule_functor; typedef date_time::first_kday_of_month<date_type> end_rule_functor; typedef date_time::first_kday_of_month<date_type> start_rule_functor_pre2007; typedef date_time::last_kday_of_month<date_type> end_rule_functor_pre2007; static day_of_week_type start_day(year_type) {return Sunday;} static month_type start_month(year_type y) { if (y < 2007) return Apr; return Mar; } static day_of_week_type end_day(year_type) {return Sunday;} static month_type end_month(year_type y) { if (y < 2007) return Oct; return Nov; } static date_type local_dst_start_day(year_type year) { if (year < 2007) { start_rule_functor_pre2007 start1(start_day(year), start_month(year)); return start1.get_date(year); } start_rule_functor start(start_rule_functor::second, start_day(year), start_month(year)); return start.get_date(year); } static date_type local_dst_end_day(year_type year) { if (year < 2007) { end_rule_functor_pre2007 end_rule(end_day(year), end_month(year)); return end_rule.get_date(year); } end_rule_functor end(end_day(year), end_month(year)); return end.get_date(year); } static int dst_start_offset_minutes() { return 120;} static int dst_end_offset_minutes() { return 120; } static int dst_shift_length_minutes() { return 60; } }; //!Rules for daylight savings start in the EU (Last Sun in Mar) /*!These amount to the following: - Start of dst day is last Sunday in March - End day of dst is last Sunday in Oct - Going forward switch time is 2:00 am (offset 120 minutes) - Going back switch time is 3:00 am (off set 180 minutes) - Shift duration is one hour (60 minutes) */ template<class date_type> struct eu_dst_trait { typedef typename date_type::day_of_week_type day_of_week_type; typedef typename date_type::month_type month_type; typedef typename date_type::year_type year_type; typedef date_time::last_kday_of_month<date_type> start_rule_functor; typedef date_time::last_kday_of_month<date_type> end_rule_functor; static day_of_week_type start_day(year_type) {return Sunday;} static month_type start_month(year_type) {return Mar;} static day_of_week_type end_day(year_type) {return Sunday;} static month_type end_month(year_type) {return Oct;} static int dst_start_offset_minutes() { return 120;} static int dst_end_offset_minutes() { return 180; } static int dst_shift_length_minutes() { return 60; } static date_type local_dst_start_day(year_type year) { start_rule_functor start(start_day(year), start_month(year)); return start.get_date(year); } static date_type local_dst_end_day(year_type year) { end_rule_functor end(end_day(year), end_month(year)); return end.get_date(year); } }; //! Alternative dst traits for some parts of the United Kingdom /* Several places in the UK use EU start and end rules for the day, but different local conversion times (eg: forward change at 1:00 am local and backward change at 2:00 am dst instead of 2:00am forward and 3:00am back for the EU). */ template<class date_type> struct uk_dst_trait : public eu_dst_trait<date_type> { static int dst_start_offset_minutes() { return 60;} static int dst_end_offset_minutes() { return 120; } static int dst_shift_length_minutes() { return 60; } }; //Rules for Adelaide Australia template<class date_type> struct acst_dst_trait { typedef typename date_type::day_of_week_type day_of_week_type; typedef typename date_type::month_type month_type; typedef typename date_type::year_type year_type; typedef date_time::last_kday_of_month<date_type> start_rule_functor; typedef date_time::last_kday_of_month<date_type> end_rule_functor; static day_of_week_type start_day(year_type) {return Sunday;} static month_type start_month(year_type) {return Oct;} static day_of_week_type end_day(year_type) {return Sunday;} static month_type end_month(year_type) {return Mar;} static int dst_start_offset_minutes() { return 120;} static int dst_end_offset_minutes() { return 180; } static int dst_shift_length_minutes() { return 60; } static date_type local_dst_start_day(year_type year) { start_rule_functor start(start_day(year), start_month(year)); return start.get_date(year); } static date_type local_dst_end_day(year_type year) { end_rule_functor end(end_day(year), end_month(year)); return end.get_date(year); } }; } } //namespace boost::date_time #endif
Save
cmd:
run