Skip to content

Commit c96c289

Browse files
committed
docs: update Time for DateTimeImmutable
1 parent 6d40755 commit c96c289

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

user_guide_src/source/libraries/time.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
Times and Dates
33
###############
44

5-
CodeIgniter provides a fully-localized, immutable, date/time class that is built on PHP's DateTime object, but uses the Intl
5+
CodeIgniter provides a fully-localized, immutable, date/time class that is built on PHP's DateTimeImmutable object, but uses the Intl
66
extension's features to convert times across timezones and display the output correctly for different locales. This class
77
is the ``Time`` class and lives in the ``CodeIgniter\I18n`` namespace.
88

9-
.. note:: Since the Time class extends DateTime, if there are features that you need that this class doesn't provide,
10-
you can likely find them within the `DateTime <https://www.php.net/manual/en/class.datetime.php>`_ class itself.
9+
.. note:: Since the Time class extends DateTimeImmutable, if there are features that you need that this class doesn't provide,
10+
you can likely find them within the `DateTime <https://www.php.net/manual/en/class.datetimeimmutable.php>`_ class itself.
1111

1212
.. contents::
1313
:local:
@@ -42,7 +42,7 @@ in the second and parameters, respectively. If no locale or timezone is provided
4242
parse()
4343
=======
4444

45-
This helper method is a static version of the default constructor. It takes a string acceptable as DateTime's
45+
This helper method is a static version of the default constructor. It takes a string acceptable as DateTimeImmutable's
4646
constructor as the first parameter, a timezone as the second parameter, and the locale as the third parameter:
4747

4848
.. literalinclude:: time/004.php
@@ -101,8 +101,8 @@ timezone and locale in the fourth and fifth parameters:
101101
createFromFormat()
102102
==================
103103

104-
This is a replacement for DateTime's method of the same name. This allows the timezone to be set at the same time,
105-
and returns a ``Time`` instance, instead of DateTime:
104+
This is a replacement for DateTimeImmutable's method of the same name. This allows the timezone to be set at the same time,
105+
and returns a ``Time`` instance, instead of DateTimeImmutable:
106106

107107
.. literalinclude:: time/011.php
108108

@@ -136,14 +136,14 @@ not aware of locales:
136136
Displaying the Value
137137
********************
138138

139-
Since the Time class extends DateTime, you get all of the output methods that provides, including the ``format()`` method.
140-
However, the DateTime methods do not provide a localized result. The Time class does provide a number of helper methods
139+
Since the Time class extends DateTimeImmutable, you get all of the output methods that provides, including the ``format()`` method.
140+
However, the DateTimeImmutable methods do not provide a localized result. The Time class does provide a number of helper methods
141141
to display localized versions of the value, though.
142142

143143
toLocalizedString()
144144
===================
145145

146-
This is the localized version of DateTime's ``format()`` method. Instead of using the values you might be familiar with, though,
146+
This is the localized version of DateTimeImmutable's ``format()`` method. Instead of using the values you might be familiar with, though,
147147
you must use values acceptable to the `IntlDateFormatter <https://www.php.net/manual/en/class.intldateformatter.php>`__ class.
148148
A full listing of values can be found `here <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classSimpleDateFormat.html#details>`__.
149149

0 commit comments

Comments
 (0)