Local Time Adjustment
Overall Index --
Gregorian Index --
Posix Time Index
Local Time Adjustment
Header --
Class Overview
A frequent problem in time representation is the conversion between
various local time systems. In general this is accomplished by
using a reference time system. The reference time system is typically
UTC.
時間表現において頻繁にぶつかる問題が、様々な地域時間の間の変換である。
一般に、これは参考時間システムを用いて解決される。
参考時間システムには、典型的に UTC が用いられる。
Since the posix_time system does no internal time adjustment it
can be used to represent both local times and UTC times. However,
the user is currently left to handle conversions and time zone
knowledge explicitly.
posix_time システムは内部で時間調整を行わないので、地域時間および UTC時間の両方を表わすために使用することができる。
しかしながら、ユーザーには変換と時間帯についての知識を処理することが委ねられる。
The library offers two different ways to perform UTC to local conversions.
The first is using the time zone settings of the computer. This is
a useful solution for converting a UTC time for a user machine. This
approach depends on the ctime API and will provide incorrect results
if the environment is set incorrectly.
The other approach allows conversion from any zone to UTC and back
independent of the settings of the time zone settings of the
computer. The
local utc conversion example
demonstrates both of these techniques.
ライブラリは UTC から地域時間への変換を処理するための、2つの異なる方法を提示する。
一つ目は、コンピュータの時間帯設定を使う。
これは、ユーザーマシンのための UTC 時刻を変換することに対して、有用な解決法である。
このアプローチは ctime API に依存しており、もし環境設定が間違っていれば、正しくない結果を供給するであろう。
もうひとつのアプローチは、コンピュータの時間帯設定とは無関係に、任意の時間帯から UTC への変換を可能にする。
#include "boost/date_time/gregorian/gregorian.hpp" //include all types plus i/o
or
#include "boost/date_time/gregorian/gregorian_types.hpp" //no i/o just types
Class |
Description |
Example |
date_time::c_local_adjustor<ptime>::utc_to_local(ptime) |
時間帯の設定および C API に基づいた UTC 時刻から、ローカルマシンの時刻を計算する |
typedef boost::date_time::c_local_adjustor<ptime> local_adj;
ptime t10(date(2002,Jan,1), hours(7));
ptime t11 = local_adj::utc_to_local(t10);
|
date_time::local_adjustor<ptime, utc_offset, dst_rules>::utc_to_local(ptime) |
UTC 時間に基づいた夏時間規則とUTCオフセットから、ローカルマシンの時刻を計算する |
例を参照 |
date_time::local_adjustor<ptime, utc_offset, dst_rules>::local_to_utc(ptime) |
夏時間規則とUTCオフセットに基づいて、UTC時刻を計算する |
例を参照 |
Last modified: Thu Sep 5 07:34:28 MST 2002
by Jeff Garland © 2000-2002
Japanese Translation Copyright (C) 2003 Shoji Shinohara.