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 GREG_DATE_HPP___ #define GREG_DATE_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/date.hpp" #include "boost/date_time/special_defs.hpp" #include "boost/date_time/gregorian/greg_calendar.hpp" #include "boost/date_time/gregorian/greg_duration.hpp" namespace boost { namespace gregorian { //bring special enum values into the namespace using date_time::special_values; using date_time::not_special; using date_time::neg_infin; using date_time::pos_infin; using date_time::not_a_date_time; using date_time::max_date_time; using date_time::min_date_time; //! A date type based on gregorian_calendar /*! This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be freely passed by value. All comparison operators are supported. \ingroup date_basics */ class date : public date_time::date
{ public: typedef gregorian_calendar::year_type year_type; typedef gregorian_calendar::month_type month_type; typedef gregorian_calendar::day_type day_type; typedef gregorian_calendar::day_of_year_type day_of_year_type; typedef gregorian_calendar::ymd_type ymd_type; typedef gregorian_calendar::date_rep_type date_rep_type; typedef gregorian_calendar::date_int_type date_int_type; typedef date_duration duration_type; #if !defined(DATE_TIME_NO_DEFAULT_CONSTRUCTOR) //! Default constructor constructs with not_a_date_time date(): date_time::date
(date_rep_type::from_special(not_a_date_time)) {} #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR //! Main constructor with year, month, day date(year_type y, month_type m, day_type d) : date_time::date
(y, m, d) { if (gregorian_calendar::end_of_month_day(y, m) < d) { throw bad_day_of_month(std::string("Day of month is not valid for year")); } } //! Constructor from a ymd_type structure explicit date(const ymd_type& ymd) : date_time::date
(ymd) {} //! Needed copy constructor explicit date(const date_int_type& rhs): date_time::date
(rhs) {} //! Needed copy constructor explicit date(date_rep_type rhs): date_time::date
(rhs) {} //! Constructor for infinities, not a date, max and min date explicit date(special_values sv): date_time::date
(date_rep_type::from_special(sv)) { if (sv == min_date_time) { *this = date(1400, 1, 1); } if (sv == max_date_time) { *this = date(9999, 12, 31); } } //!Return the Julian Day number for the date. date_int_type julian_day() const { ymd_type ymd = year_month_day(); return gregorian_calendar::julian_day_number(ymd); } //!Return the day of year 1..365 or 1..366 (for leap year) day_of_year_type day_of_year() const { date start_of_year(year(), 1, 1); unsigned short doy = static_cast
((*this-start_of_year).days() + 1); return day_of_year_type(doy); } //!Return the Modified Julian Day number for the date. long modjulian_day() const { ymd_type ymd = year_month_day(); return gregorian_calendar::modjulian_day_number(ymd); } //!Return the iso 8601 week number 1..53 int week_number() const { ymd_type ymd = year_month_day(); return gregorian_calendar::week_number(ymd); } //! Return the day number from the calendar date_int_type day_number() const { return days_; } //! Return the last day of the current month date end_of_month() const { ymd_type ymd = year_month_day(); short eom_day = gregorian_calendar::end_of_month_day(ymd.year, ymd.month); return date(ymd.year, ymd.month, eom_day); } private: }; } } //namespace gregorian #endif
greg_date.hpp
Page URL
File URL
Prev
5/19
Next
Download
( 4 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.