DriveHQ Start Menu
Cloud Drive Mapping
Folder Sync
Cloud Backup
True Drop Box
FTP/SFTP Hosting
Group Account
DriveHQ Start Menu
Online File Server
My Storage
|
Manage Shares
|
Publishes
|
Drop Boxes
|
Group Account
WebDAV Drive Mapping
Cloud Drive Home
|
WebDAV Guide
|
Drive Mapping Tool
|
Drive Mapping URL
Complete Data Backup
Backup Guide
|
Online Backup Tool
|
Cloud-to-Cloud Backup
FTP, Email & Web Service
FTP Home
|
FTP Hosting FAQ
|
Email Hosting
|
EmailManager
|
Web Hosting
Help & Resources
About
|
Enterprise Service
|
Partnership
|
Comparisons
|
Support
Quick Links
Security and Privacy
Download Software
Service Manual
Use Cases
Group Account
Online Help
Blog
Contact
Cloud Surveillance
Sign Up
Login
Features
Business Features
Online File Server
FTP Hosting
Cloud Drive Mapping
Cloud File Backup
Email Backup & Hosting
Cloud File Sharing
Folder Synchronization
Group Management
True Drop Box
Full-text Search
AD Integration/SSO
Mobile Access
IP Camera & DVR Solution
More...
Personal Features
Personal Cloud Drive
Backup All Devices
Mobile APPs
Personal Web Hosting
Sub-Account (for Kids)
Home/PC/Kids Monitoring
More...
Software
DriveHQ Drive Mapping Tool
DriveHQ FileManager
DriveHQ Online Backup
DriveHQ Mobile Apps
Pricing
Business Plans & Pricing
Personal Plans & Pricing
Price Comparison with Others
Feature Comparison with Others
Install Mobile App
Sign up
Creating account...
Invalid character in username! Only 0-9, a-z, A-Z, _, -, . allowed.
Username is required!
Invalid email address!
E-mail is required!
Password is required!
Password is invalid!
Password and confirmation do not match.
Confirm password is required!
I accept
Membership Agreement
Please read the Membership Agreement and check "I accept"!
Free Quick Sign-up
Sign-up Page
Log in
Signing in...
Username or e-mail address is required!
Password is required!
Keep me logged in
Quick Login
Forgot Password
Up
Upload
Download
Share
Publish
New Folder
New File
Copy
Cut
Delete
Paste
Rate
Upgrade
Rotate
Effect
Edit
Slide
History
#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: 2008-02-27 15:00:24 -0500 (Wed, 27 Feb 2008) $ */ #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
us_dst_traits; typedef boost::date_time::dst_calc_engine
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
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
start_rule_functor; typedef date_time::first_kday_of_month
end_rule_functor; typedef date_time::first_kday_of_month
start_rule_functor_pre2007; typedef date_time::last_kday_of_month
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 y) {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
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
start_rule_functor; typedef date_time::last_kday_of_month
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
struct uk_dst_trait : public eu_dst_trait
{ 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
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
start_rule_functor; typedef date_time::last_kday_of_month
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
local_timezone_defs.hpp
Page URL
File URL
Prev
31/60
Next
Download
( 7 KB )
Note: The DriveHQ service banners will NOT be displayed if the file owner is a paid member.
Comments
Total ratings:
0
Average rating:
Not Rated
Would you like to comment?
Join DriveHQ
for a free account, or
Logon
if you are already a member.