C++ Boost

Gregorian Date System Documentation


Overall Index

Introduction -- Usage Examples

Temporal Types

Class date -- Class date_duration -- Class date_period

Other Topics

Date Iterators -- Date Generators / Algorithms -- Class gregorian_calendar -- Class day_clock

Introduction

The gregorian date system provides a date programming system based on the Gregorian Calendar. The current implementation supports dates in the range 1400-Jan-01 to 10000-Jan-01. The implemented calendar is a "propleptic Gregorian calendar" thus extending dates back prior to it's first adoption in in 1582.
propleptic -> proleptic
gregorian date system はグレゴリオ暦に基づいた日付プログラミングシステムを提供する。 現在の実装は,1400-Jan-01から10000-Jan-01の範囲の日付をサポートする。 実装された暦は、"予想グレゴリオ暦?(proleptic Gregorian calendar)" で、(グレゴリオ暦が)最初に採用された 1582 年以前に遡る拡張がなされている。
訳注: proleptic Gregorian calendar

Caution is required when handling historic dates as there are many adjustments required to account for the local adoption of various calendar systems. See Calendrical Calculations by Reingold & Dershowitz for more details. The current historical range of the calendar is not limited by algorithm, but rather time to write and perform tests to ensure correctness. It is expected that the range of this calendar system will continue to increase in the future.
歴史上の日付を扱うとき,局地的に採用された様々な暦法との調整が必要な事に注意すべきである。 Reingold と Dershowitz による Calendrical Calculations に詳しい説明がある。 暦法の現在の歴史上の範囲はアルゴリズムによって制限されてはいない。 しかしそれよりもむしろ、時間の正当性を保証するためにテストを書いて実行する。 この暦法系の範囲が将来増加し続けるであろうと思われる。

Date information from Calendrical Calculations has been used to cross-test the correctness of the Gregorian calendar implementation.
Calendrical Calculations からの日付情報がグレゴリオ暦の実装の正当性をクロステストするために使われた。

All types for the gregorian system are found in namespace boost::gregorian. The library supports a convience header boost/date_time/gregorian/gregorian_types.hpp that will include all the classes of the library with no input/output depedency. Another header boost/date_time/gregorian/gregorian.hpp will include the types and the input/output code.
gregorian system の全ての型は boost::gregorian 名前空間で見つかる。 ライブラリは入出力に依存しない全てのクラスが収められた便宜的なヘッダ boost/date_time/gregorian/gregorian_types.hpp をサポートする。
convience は convenience かと…
もう一つのヘッダ boost/date_time/gregorian/gregorian.hpp は型と入出力コードを含む。

The class boost::gregorian::date is the primary temporal type for users. If you are interested in learning about writing programs do specialized date calculations such as finding the "first sunday in april" see the date generators and algorithms page.
boost::gregorian::date クラスはユーザーにとって主要な時間型である。 もし,"4月の第1日曜日"を見つけるといった特別な日付計算プログラムの書き方に興味があるなら、date generators and algorithms page を見ると良い。

Usage Examples

ExampleDescription
Days Alive Days Till New Year 簡単な日数計算。現在の日付を時計から取得
Dates as strings 日付と文字列の相互変換、簡単な解析と書式化
Date Period Calculations 日付が、期間(periods)の集合に含まれるか調べる (例: 休日・週末の判定)
Print a month コマンドラインで与えた月の日付を全て出力する小さなユーティリティプログラム。 1999年1月1日が金曜だったか土曜だったか知る必要がある? このプログラムはその方法を示す
Print Holidays 抽象的な指定を具体的な日付の集合に変換するために、日付ジェネレータを使う


Last modified: Thu Sep 5 07:33:06 MST 2002 by Jeff Garland © 2000-2002
Japanese Translation Copyright (C) 2003 Shoji Shinohara.