<?xml version="1.0" encoding="Shift_JIS"?>
<!--
  Copyright 2003-2004 The Apache Software Foundation.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

  $Id: DateTool.xml,v 1.6 2005/03/16 10:46:30 nekop Exp $
-->
<document>

    <properties>
        <title>DateTool</title>
        <author email="sidler@apache.org">Gabriel Sidler</author>
        <translator email="nekop@programmers.jp">木村 貴由</translator>
        <translator email="tatakaha@jajakarta.org">高橋 達男</translator>
        <projectfile>xdocs-ja/generic/menu.xml</projectfile>
        <original>ImportTool</original>
    </properties>

    <body>

    <section name="DateTool Reference Documentation" alias="DateTool リファレンスドキュメント">

        <primary>
        <p>
        Tool for accessing, manipulating, and converting<code>java.util.Date</code> 
        and <code>java.util.Calendar</code> objects in Velocity templates. It 
        supports locales to format dates language and country specific.
        </p>
        </primary>
        <p>
        Velocity テンプレート内で、<code>java.util.Date</code> と
        <code>java.util.Calendar</code> オブジェクトへのアクセス、
        操作、変換を行うツールです。
        言語や国特有の日付フォーマットのためのロカールをサポートしています。
        </p>
        
        <toolinfo>
            <version>@@@version@@@, @@@date@@@</version>

            <clazz>org.apache.velocity.tools.generic.DateTool</clazz>

            <name>$date</name>

            <author email="nathan@esha.com">Nathan Bubna</author>

            <config-example>&lt;tool&gt;
  &lt;key&gt;date&lt;/key&gt;
  &lt;scope&gt;application&lt;/scope&gt;
  &lt;class&gt;org.apache.velocity.tools.generic.DateTool&lt;/class&gt;
&lt;/tool&gt;</config-example>

        </toolinfo>

        <methods/>

    </section>

    <section name="getDate()">
        <primary>
        <method name="getDate()">
    
            <abstract>
                Returns a Date object representing the time at which this 
                method was invoked.
            </abstract>
    
            <signature>
                String getDate()
            </signature>
            
            <signature>
                String getDate(Locale locale)
            </signature>
            
            <parameters>
                <parameter name="locale">
                    An object of class <code>java.util.Locale</code> that represents the locale
                    to be used to create the date.
                </parameter>
            </parameters>
                    
            <returns>
                An object of class <code>java.util.Date</code> representing the time at which this 
                method was invoked in the specified locale. If no locale is specified,
                the system's default locale is used.
            </returns>
                
        </method>
        </primary>
        <method name="getDate()">
    
            <abstract>
                メソッドが呼び出された時点での時間を表す
                Date オブジェクトを返却します。
            </abstract>
    
            <signature>
                String getDate()
            </signature>
            
            <signature>
                String getDate(Locale locale)
            </signature>
            
            <parameters>
                <parameter name="locale">
                    Date を作成するのに使用されるロカールを示す
                    <code>java.util.Locale</code> クラスのオブジェクト。
                </parameter>
            </parameters>
                    
            <returns>
                指定されたロカールでの、メソッドが呼び出された時点での時間を表す <code>java.util.Date</code> クラスのオブジェクトを返却します。
                ロカールが指定されなかった場合、システムのデフォルトロカールが使用されます。
            </returns>
                
        </method>
    </section>


    <section name="getCalendar()">
        <primary>
        <method name="getCalendar()">
    
            <abstract>
                Returns a Calendar object representing the time at which this 
                method was invoked.
            </abstract>
    
            <signature>
                String getCalendar()
            </signature>
            
            <signature>
                String getCalendar(Locale locale)
            </signature>
            
            <parameters>
                <parameter name="locale">
                    An object of class <code>java.util.Locale</code> that represents the locale
                    to be used to create the calendar.
                </parameter>
            </parameters>
                    
            <returns>
                An object of class <code>java.util.Calendar</code> representing the time at which this 
                method was invoked in the specified locale. If no locale is specified,
                the system's default locale is used.
            </returns>
                
        </method>
        </primary>
        <method name="getCalendar()">
    
            <abstract>
                メソッドが呼び出された時点での時間を表す
                Calender オブジェクトを返却します。
            </abstract>
    
            <signature>
                String getCalendar()
            </signature>
            
            <signature>
                String getCalendar(Locale locale)
            </signature>
            
            <parameters>
                <parameter name="locale">
                    Calender を作成するのに使用されるロカールを示す
                    <code>java.util.Locale</code> クラスのオブジェクト。
                </parameter>
            </parameters>
                    
            <returns>
                指定されたロカールでの、メソッドが呼び出された時点での時間を表す <code>java.util.Calendar</code> クラスのオブジェクトを返却します。
                ロカールが指定されなかった場合、システムのデフォルトロカールが使用されます。
            </returns>
                
        </method>
    </section>


    <section name="format()">
        <primary>
        <method name="format()">
    
            <abstract>
                Returns a formatted string representing the specified date.
            </abstract>
    
            <signature>
                String format(String format, Object obj)
            </signature>
            
            <signature>
                String format(String format, Object obj, Locale locale)
            </signature>
            
            <parameters>
                <parameter name="format">
                    A string that represents the formatting instructions according to
                    <code>java.text.SimpleDateFormat</code>. See also below.
                </parameter>
                
                <parameter name="obj">
                    An object of class <code>java.util.Date</code> or <code>java.util.Calendar</code>. It is
                    also possible to pass a string that represents a parsable date
                    according to <code>java.text.DateFormat</code>.
                </parameter>
                
                <parameter name="locale">
                    An object of class <code>java.util.Locale</code> that represents the locale
                    to format the date for.
                </parameter>
            </parameters>
    
            <returns>
                The formatted date string in the specified locale or <code>null</code> 
                if one or several input parameters are invalid. If no locale is specified,
                the system's default locale is used instead.
            </returns>
    
            <description>
                <p>This methods use the same formatting instructions as class 
                <code>java.text.SimpleDateFormat</code>.</p>
                
<sourcecode>
Symbol   Meaning                 Presentation        Example
------   -------                 ------------        -------
G        era designator          (Text)              AD
y        year                    (Number)            1996
M        month in year           (Text &amp; Number)     July &amp; 07
d        day in month            (Number)            10
h        hour in am/pm (1~12)    (Number)            12
H        hour in day (0~23)      (Number)            0
m        minute in hour          (Number)            30
s        second in minute        (Number)            55
S        millisecond             (Number)            978
E        day in week             (Text)              Tuesday
D        day in year             (Number)            189
F        day of week in month    (Number)            2 (2nd Wed in July)
w        week in year            (Number)            27
W        week in month           (Number)            2
a        am/pm marker            (Text)              PM
k        hour in day (1~24)      (Number)            24
K        hour in am/pm (0~11)    (Number)            0
z        time zone               (Text)              Pacific Standard Time
'        escape for text         (Delimiter)
''       single quote            (Literal)           '     

Examples: "E, MMMM d" will result in "Tue, July 24"
          "EEE, M-d (H:m)" will result in "Tuesday, 7-24 (14:12)"
</sourcecode>
            
            </description>
    
        </method>
        </primary>
        <method name="format()">
    
            <abstract>
                指定された日付をフォーマットした文字列を返却します。
            </abstract>
    
            <signature>
                String format(String format, Object obj)
            </signature>
            
            <signature>
                String format(String format, Object obj, Locale locale)
            </signature>
            
            <parameters>
                <parameter name="format">
                    <code>java.text.SimpleDateFormat</code> に従ったフォーマット指定を表す String 。以下を参照してください。
                </parameter>
                
                <parameter name="obj">
                    <code>java.util.Date</code> または <code>java.util.Calendar</code> クラスのオブジェクト。
                    <code>java.text.DateFormat</code> に従って解析可能な日付を表す String でも可。
                </parameter>
                
                <parameter name="locale">
                    日付のフォーマットに使用されるロカールを示す
                    <code>java.util.Locale</code> クラスのオブジェクト。
                </parameter>
            </parameters>
    
            <returns>
                指定されたロカールでフォーマットされた日付を表す String 。
                引数に不正なものが含まれていた場合は <code>null</code> 。
                ロカールが指定されなかった場合、システムのデフォルトロカールが使用されます。
            </returns>
    
            <description>
                <p>このメソッドは <code>java.text.SimpleDateFormat</code> クラスと同じフォーマット指定を使用します。</p>
                
<sourcecode>
Symbol   Meaning                 Presentation        Example
------   -------                 ------------        -------
G        年号                    (Text)              AD
y        年                      (Number)            1996
M        月                      (Text &amp; Number)     July &amp; 07
d        月における日             (Number)            10
h        午前/午後の時(1-12)      (Number)            12
H        一日における時(0-23)     (Number)            0
m        分                      (Number)            30
s        秒                      (Number)            55
S        ミリ秒                  (Number)            978
E        曜日                    (Text)              Tuesday
D        年における日             (Number)            189
F        月における曜日           (Number)            2 (2nd Wed in July)
w        年における週             (Number)            27
W        月における週             (Number)            2
a        午前/午後               (Text)              PM
k        一日における時(1-24)     (Number)            24
K        午前/午後の時(0-11)      (Number)            0
z        タイムゾーン            (Text)              Pacific Standard Time
'        テキストのエスケープ     (Delimiter)
''       シングルクオート         (Literal)           '     

例: "E, MMMM d" は "Tue, July 24" となり、
    "EEE, M-d (H:m)" は "Tuesday, 7-24 (14:12)" となります。
</sourcecode>
            
            </description>
    
        </method>
    </section>



    <section name="toDate()">
        <primary>
        <method name="toDate()">
    
            <abstract>
                Returns a Date object representing the specified date.
            </abstract>
    
            <signature>
                Date toDate(Object obj)
            </signature>
            
            <parameters>
                <parameter name="obj">
                    The date to convert. The parameter can be an object of class 
                    <code>java.util.Date</code> or <code>java.util.Calendar</code>. It is also possible to 
                    pass a string that represents a parsable date according to 
                    <code>java.text.DateFormat</code>.
                </parameter>
            </parameters>
                    
            <returns>
                An object of class <code>java.util.Date</code> representing the converted date 
                or <null></null> of the input parameter is invalid.
            </returns>
       
        </method>
        </primary>
        <method name="toDate()">
    
            <abstract>
                指定された日付を表す Date オブジェクトを返却します。
            </abstract>
    
            <signature>
                Date toDate(Object obj)
            </signature>
            
            <parameters>
                <parameter name="obj">
                    変換する日付。
                    パラメータは <code>java.util.Date</code> または <code>java.util.Calendar</code> クラスのオブジェクト。
                    <code>java.text.DateFormat</code> に従って解析可能な日付を表す String でも可。
                </parameter>
            </parameters>
                    
            <returns>
                変換された日付を表す <code>java.util.Date</code> クラスのオブジェクト。
                パラメータが不正の場合は <code>null</code> 。
            </returns>
       
        </method>
    </section>


    <section name="toCalendar()">
        <primary>
        <method name="toCalendar()">
    
            <abstract>
                Returns a Calendar object representing the specified date.
            </abstract>
    
            <signature>
                Calendar toCalendar(Object obj)
            </signature>
            
            <parameters>
                <parameter name="obj">
                    The date to convert. The parameter can be an object of class 
                    <code>java.util.Date</code> or <code>java.util.Calendar</code>. It is also possible to 
                    pass a string that represents a parsable date according to 
                    <code>java.text.DateFormat</code>.
                </parameter>
             </parameters>
                    
            <returns>
                An object of class <code>java.util.Calendar</code> representing the converted date 
                or <null></null> of the input parameter is invalid.
            </returns>
       
        </method>
        </primary>
        <method name="toCalendar()">
    
            <abstract>
                指定された日付を表す Calendar オブジェクトを返却します。
            </abstract>
    
            <signature>
                Calendar toCalendar(Object obj)
            </signature>
            
            <parameters>
                <parameter name="obj">
                    変換する日付。
                    パラメータは <code>java.util.Date</code> または <code>java.util.Calendar</code> クラスのオブジェクト。
                    <code>java.text.DateFormat</code> に従って解析可能な日付を表す String でも可。
                </parameter>
             </parameters>
                    
            <returns>
                変換された日付を表す <code>java.util.Calendar</code> クラスのオブジェクト。
                パラメータが不正の場合は <code>null</code> 。
            </returns>
       
        </method>
    </section>



 </body>
</document>

