Просмотр исходного кода

[DOCUMENTATION] English:

- manual fixes

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@17910 44c647ce-9c0f-0410-b52a-842ac1e357ba
thomas 16 лет назад
Родитель
Сommit
b8e08f9ced

+ 57 - 70
documentation/manual/en/module_specs/Zend_Date-Creation.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
 <sect1 id="zend.date.creation">
-
     <title>Creation of Dates</title>
 
     <para>
@@ -10,19 +9,17 @@
     </para>
 
     <sect2 id="zend.date.creation.actual">
-
         <title>Create the Actual Date</title>
 
         <para>
             The simplest way of creating a date object is to create the actual date. You can either
-            create a new instance with <emphasis>new Zend_Date()</emphasis> or use the convenient
-            static method <emphasis>Zend_Date::now()</emphasis> which both will return the actual
-            date as new instance of <classname>Zend_Date</classname>. The actual date always include
-            the actual date and time for the actual set timezone.
+            create a new instance with <command>new Zend_Date()</command> or use the convenient
+            static method <methodname>Zend_Date::now()</methodname> which both will return the
+            actual date as new instance of <classname>Zend_Date</classname>. The actual date always
+            include the actual date and time for the actual set timezone.
         </para>
 
         <example id="zend.date.creation.actual.example-1">
-
             <title>Date Creation by Instance</title>
 
             <para>
@@ -39,7 +36,6 @@ $date = new Zend_Date();
         </example>
 
         <example id="zend.date.creation.actual.example-2">
-
             <title>Static Date Creation</title>
 
             <para>
@@ -53,28 +49,25 @@ $date = new Zend_Date();
             <programlisting language="php"><![CDATA[
 $date = Zend_Date::now();
 ]]></programlisting>
-
         </example>
-
     </sect2>
 
     <sect2 id="zend.date.creation.database">
-
         <title>Create a Date from Database</title>
 
         <para>
             Databases are often used to store date values. But the problem is, that every database
-            outputs its date values in a different way. <code>MsSQL</code> databases use a quite
-            different standard date output than <code>MySQL</code> databases. But for simplification
-            <classname>Zend_Date</classname> makes it very easy to create a date from database date
-            values.
+            outputs its date values in a different way. <emphasis>MsSQL</emphasis> databases use a
+            quite different standard date output than <emphasis>MySQL</emphasis> databases. But for
+            simplification <classname>Zend_Date</classname> makes it very easy to create a date
+            from database date values.
         </para>
 
         <para>
             Of course each database can be said to convert the output of a defined column to a
-            special value. For example you could convert a <code>datetime</code> value to output a
-            minute value. But this is time expensive and often you are in need of handling dates in
-            an other way than expected when creating the database query.
+            special value. For example you could convert a <emphasis>datetime</emphasis> value to
+            output a minute value. But this is time expensive and often you are in need of handling
+            dates in an other way than expected when creating the database query.
         </para>
 
         <para>
@@ -82,7 +75,6 @@ $date = Zend_Date::now();
         </para>
 
         <example id="zend.date.creation.database.example-1">
-
             <title>Quick Creation of Dates from Database Date Values</title>
 
             <para>
@@ -97,38 +89,33 @@ $date = Zend_Date::now();
 // SELECT UNIX_TIMESTAMP(my_datetime_column) FROM my_table
 $date = new Zend_Date($unixtimestamp, Zend_Date::TIMESTAMP);
 ]]></programlisting>
-
         </example>
 
         <example id="zend.date.creation.database.example-2">
-
             <title>Convenient Creation of Dates from Database Date Values</title>
 
             <para>
                 The standard output of all databases is quite different even if it looks the same on
-                the first eyecatch. But all are part of the <acronym>ISO</acronym> Standard and explained
-                through it. So the easiest way of date creation is the usage of
+                the first eyecatch. But all are part of the <acronym>ISO</acronym> Standard and
+                explained through it. So the easiest way of date creation is the usage of
                 <constant>Zend_Date::ISO_8601</constant>. Databases which are known to be
-                recognised by <constant>Zend_Date::ISO_8601</constant> are <code>MySQL</code>,
-                <code>MsSQL</code> for example. But all databases are also able to return a
-                <code>ISO 8601</code> representation of a date column. <code>ISO 8601</code> has the
-                big advantage that it is human readable. The disadvantage is that <code>ISO
-                8601</code> needs more time for computation than a simple unix timestamp. But it
-                should also be mentioned that unix timestamps are only supported for dates after 1
-                January 1970.
+                recognised by <constant>Zend_Date::ISO_8601</constant> are
+                <emphasis>MySQL</emphasis>, <emphasis>MsSQL</emphasis> for example. But all
+                databases are also able to return a <acronym>ISO-8601</acronym> representation of a
+                date column. <acronym>ISO-8601</acronym> has the big advantage that it is human
+                readable. The disadvantage is that <acronym>ISO-8601</acronym> needs more time for
+                computation than a simple unix timestamp. But it should also be mentioned that unix
+                timestamps are only supported for dates after 1 January 1970.
             </para>
 
             <programlisting language="php"><![CDATA[
 // SELECT datecolumn FROM my_table
 $date = new Zend_Date($datecolumn, Zend_Date::ISO_8601);
 ]]></programlisting>
-
         </example>
-
     </sect2>
 
     <sect2 id="zend.date.creation.array">
-
         <title>Create Dates from an Array</title>
 
         <para>
@@ -136,43 +123,45 @@ $date = new Zend_Date($datecolumn, Zend_Date::ISO_8601);
             used array keys are:
         </para>
 
-        <para>
-            <itemizedlist mark='opencircle'>
-                <listitem>
-                    <para>
-                        <emphasis>day</emphasis>: day of the date as number
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <emphasis>month</emphasis>: month of the date as number
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <emphasis>year</emphasis>: full year of the date
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <emphasis>hour</emphasis>: hour of the date
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <emphasis>minute</emphasis>: minute of the date
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <emphasis>second</emphasis>: second of the date
-                    </para>
-                </listitem>
-            </itemizedlist>
-        </para>
+        <itemizedlist mark='opencircle'>
+            <listitem>
+                <para>
+                    <emphasis>day</emphasis>: day of the date as number
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis>month</emphasis>: month of the date as number
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis>year</emphasis>: full year of the date
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis>hour</emphasis>: hour of the date
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis>minute</emphasis>: minute of the date
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <emphasis>second</emphasis>: second of the date
+                </para>
+            </listitem>
+        </itemizedlist>
 
         <example id="zend.date.creation.array.example">
-
             <title>Date Creation by Array</title>
 
             <para>
@@ -196,9 +185,7 @@ $datearray = array('year' => 2006, 'month' => 4, 'day' => 18);
 $date = new Zend_Date($datearray);
 ]]></programlisting>
         </example>
-
     </sect2>
-
 </sect1>
 <!--
 vim:se ts=4 sw=4 et:

+ 38 - 25
documentation/manual/en/module_specs/Zend_Date-Introduction.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
 <sect1 id="zend.date.introduction">
-
     <title>Introduction</title>
 
     <para>
@@ -31,31 +30,37 @@
     </para>
 
     <sect2 id="zend.date.setdefaulttimezone">
-
         <title>Always Set a Default Timezone</title>
 
         <para>
             Before using any date related functions in PHP or Zend Framework, first make certain
             your application has a correct default timezone, by either setting the TZ environment
-            variable, using the <code>date.timezone</code> php.ini setting, or using <ulink
+            variable, using the <property>date.timezone</property> <filename>php.ini</filename>
+            setting, or using <ulink
                 url="http://php.net/date_default_timezone_set">date_default_timezone_set()</ulink>.
             In PHP, we can adjust all date and time related functions to work for a particular user
             by setting a default timezone according to the user's expectations. For a complete list
             of timezone settings, see the <ulink
                 url="http://unicode.org/cldr/data/diff/supplemental/territory_containment_un_m_49.html">CLDR
                 Timezone Identifier List</ulink>.
-            <example id="zend.date.setdefaulttimezone.example-1">
-                <title>Setting a Default Timezone</title>
-                <programlisting language="php"><![CDATA[
+        </para>
+
+        <example id="zend.date.setdefaulttimezone.example-1">
+            <title>Setting a Default Timezone</title>
+
+            <programlisting language="php"><![CDATA[
 // timezone for an American in California
 date_default_timezone_set('America/Los_Angeles');
 // timezone for a German in Germany
 date_default_timezone_set('Europe/Berlin');
 ]]></programlisting>
-            </example>
-            <emphasis>When creating Zend_Date instances, their timezone will automatically become
-            the current default timezone!</emphasis> Thus, the timezone setting will account for any
-            Daylight Savings Time (DST) in effect, eliminating the need to explicitly specify DST.
+        </example>
+
+        <para>
+            <emphasis>When creating <classname>Zend_Date</classname> instances, their timezone will
+            automatically become the current default timezone!</emphasis> Thus, the timezone setting
+            will account for any Daylight Savings Time (DST) in effect, eliminating the need to
+            explicitly specify DST.
         </para>
 
         <para>
@@ -69,7 +74,6 @@ date_default_timezone_set('Europe/Berlin');
     </sect2>
 
     <sect2 id="zend.date.why">
-
         <title>Why Use Zend_Date?</title>
 
         <para>
@@ -82,17 +86,20 @@ date_default_timezone_set('Europe/Berlin');
                 <para>
                     Simple <acronym>API</acronym>
                 </para>
+
                 <para>
                     <classname>Zend_Date</classname> offers a very simple <acronym>API</acronym>,
-                    which combines the best of date/time functionality from four programming
+                    which combines the best of date and time functionality from four programming
                     languages. It is possible, for example, to add or compare two times within a
                     single row.
                 </para>
             </listitem>
+
             <listitem>
                 <para>
                     Completely internationalized
                 </para>
+
                 <para>
                     All full and abbreviated names of months and weekdays are supported for more
                     than 130 languages. Methods support both input and the output of dates using the
@@ -100,10 +107,12 @@ date_default_timezone_set('Europe/Berlin');
                     with each locale.
                 </para>
             </listitem>
+
             <listitem>
                 <para>
                     Unlimited timestamps
                 </para>
+
                 <para>
                     Although <acronym>PHP</acronym> 5.2 docs state, "The valid range of a timestamp
                     is typically from Fri, 13 Dec 1901 20:45:54 <acronym>GMT</acronym> to Tue, 19
@@ -112,36 +121,42 @@ date_default_timezone_set('Europe/Berlin');
                     BCMath is not available, then <classname>Zend_Date</classname> will have reduced
                     support only for timestamps within the range of the <code>float</code> type
                     supported by your server. "The size of a float is platform-dependent, although a
-                    maximum of ~1.8e308 with a precision of roughly 14 decimal digits is a common
-                    value (that's 64 bit IEEE format)." [ <ulink
-                        url="http://www.php.net/float">http://www.php.net/float</ulink> ].
+                    maximum of <command>~1.8e308</command> with a precision of roughly 14 decimal
+                    digits is a common value (that's 64 bit <acronym>IEEE</acronym> format)." [
+                    <ulink url="http://www.php.net/float">http://www.php.net/float</ulink> ].
                     Additionally, inherent limitations of float data types, and rounding error of
                     float numbers may introduce errors into calculations. To avoid these problems,
                     the Zend Framework I18n components use BCMath extension, if available.
                 </para>
             </listitem>
+
             <listitem>
                 <para>
-                    Support for ISO_8601 date specifications
+                    Support for <acronym>ISO-8601</acronym> date specifications
                 </para>
+
                 <para>
-                    ISO_8601 date specifications are supported. Even partially compliant ISO_8601
-                    date specifications will be identified. These date formats are particularly
-                    useful when working with databases. for example, even though MsSQL and <ulink
+                    <acronym>ISO-8601</acronym> date specifications are supported. Even partially
+                    compliant <acronym>ISO-8601</acronym> date specifications will be identified.
+                    These date formats are particularly useful when working with databases. for
+                    example, even though MsSQL and <ulink
                         url="http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html">MySQL</ulink>
                     differ a little from each other, both are supported by
                     <classname>Zend_Date</classname> using the <link
                         linkend="zend.date.constants.list">Zend_Date::ISO_8601</link> format
-                    specification constant. When date strings conform to "Y/m/d" or "Y-m-d H:i:s",
-                    according to <acronym>PHP</acronym> date() format tokens, use
-                    <classname>Zend_Date</classname>'s built-in support for <acronym>ISO</acronym>
-                    8601 formatted dates.
+                    specification constant. When date strings conform to "<command>Y/m/d</command>"
+                    or "<command>Y-m-d H:i:s</command>", according to <acronym>PHP</acronym>
+                    <methodname>date()</methodname> format tokens, use
+                    <classname>Zend_Date</classname>'s built-in support for
+                    <acronym>ISO-8601</acronym> formatted dates.
                 </para>
             </listitem>
+
             <listitem>
                 <para>
                     Calculate sunrise and sunset
                 </para>
+
                 <para>
                     For any place and day, the times for sunrise and sunset can be displayed, so
                     that you won't miss a single daylight second for working on your favorite
@@ -149,9 +164,7 @@ date_default_timezone_set('Europe/Berlin');
                 </para>
             </listitem>
         </itemizedlist>
-
     </sect2>
-
 </sect1>
 <!--
 vim:se ts=4 sw=4 et:

+ 42 - 43
documentation/manual/en/module_specs/Zend_Date-Theory.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- Reviewed: no -->
 <sect1 id="zend.date.definition.theory">
-
     <title>Theory of Operation</title>
 
     <para>
@@ -24,51 +23,51 @@
     </para>
 
     <sect2 id="zend.date.theory.internals">
-
         <title>Internals</title>
 
-        <para>
-            <itemizedlist mark='opencircle'>
-                <listitem>
-                    <para>
-                        UNIX Timestamp
-                    </para>
-                    <para>
-                        All dates and times, even ambiguous ones (e.g. no year), are represented
-                        internally as absolute moments in time, represented as a UNIX timestamp
-                        expressing the difference between the desired time and January 1st, 1970
-                        00:00:00 <acronym>GMT</acronym>/UTC. This was only possible, because
-                        <classname>Zend_Date</classname> is not limited to UNIX timestamps nor
-                        integer values. The BCMath extension is required to support extremely large
-                        dates outside of the range Fri, 13 Dec 1901 20:45:54 <acronym>GMT</acronym>
-                        to Tue, 19 Jan 2038 03:14:07 <acronym>GMT</acronym>. Additional, tiny math
-                        errors may arise due to the inherent limitations of float data types and
-                        rounding, unless using the BCMath extension.
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        Date parts as timestamp offsets
-                    </para>
-                    <para>
-                        Thus, an instance object representing three hours would be expressed as
-                        three hours after January 1st, 1970 00:00:00 <acronym>GMT</acronym>/UTC
-                        -i.e. 0 + 3 * 60 * 60 = 10800.
-                    </para>
-                </listitem>
-                <listitem>
-                    <para>
-                        <acronym>PHP</acronym> functions
-                    </para>
-                    <para>
-                        Where possible, <classname>Zend_Date</classname> usually uses
-                        <acronym>PHP</acronym> functions to improve performance.
-                    </para>
-                </listitem>
-            </itemizedlist>
-        </para>
+        <itemizedlist mark='opencircle'>
+            <listitem>
+                <para>
+                    UNIX Timestamp
+                </para>
 
-    </sect2>
+                <para>
+                    All dates and times, even ambiguous ones (e.g. no year), are represented
+                    internally as absolute moments in time, represented as a UNIX timestamp
+                    expressing the difference between the desired time and January 1st, 1970
+                    00:00:00 <acronym>GMT</acronym>/UTC. This was only possible, because
+                    <classname>Zend_Date</classname> is not limited to UNIX timestamps nor
+                    integer values. The BCMath extension is required to support extremely large
+                    dates outside of the range Fri, 13 Dec 1901 20:45:54 <acronym>GMT</acronym>
+                    to Tue, 19 Jan 2038 03:14:07 <acronym>GMT</acronym>. Additional, tiny math
+                    errors may arise due to the inherent limitations of float data types and
+                    rounding, unless using the BCMath extension.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Date parts as timestamp offsets
+                </para>
 
+                <para>
+                    Thus, an instance object representing three hours would be expressed as
+                    three hours after January 1st, 1970 00:00:00 <acronym>GMT</acronym>/UTC
+                    -i.e. 0 + 3 * 60 * 60 = 10800.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    <acronym>PHP</acronym> functions
+                </para>
+
+                <para>
+                    Where possible, <classname>Zend_Date</classname> usually uses
+                    <acronym>PHP</acronym> functions to improve performance.
+                </para>
+            </listitem>
+        </itemizedlist>
+    </sect2>
 </sect1>
 <!--vim:se ts=4 sw=4 et:-->