File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ extension's features to convert times across timezones and display the output co
77is the ``Time `` class and lives in the ``CodeIgniter\I18n `` namespace.
88
99.. 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 `DateTimeImmutable <https://www.php.net/manual/en/class.datetimeimmutable.php >`_ class itself.
10+ you can likely find them within the `DateTimeImmutable `_ class itself.
11+
12+ .. _DateTimeImmutable : https://www.php.net/manual/en/class.datetimeimmutable.php
1113
1214.. note :: Prior to v4.3.0, the Time class extended ``DateTime`` and some inherited methods changed
1315 the current object state. The bug was fixed in v4.3.0. If you need the old Time class for backward
@@ -24,10 +26,11 @@ Instantiating
2426There are several ways that a new Time instance can be created. The first is simply to create a new instance
2527like any other class.
2628
27- When you do it this way, you can pass in a string representing the desired time. This can
28- be any string that PHP's `strtotime() `_ function can parse:
29+ When you do it this way, you can pass in a string representing the desired time.
30+ This can be any string that PHP's `DateTimeImmutable `_ constructor can parse. See
31+ `Supported Date and Time Formats `_ for details.
2932
30- .. _ strtotime() : https://www.php.net/manual/en/function.strtotime .php
33+ .. _ Supported Date and Time Formats : https://www.php.net/manual/en/datetime.formats .php
3134
3235.. literalinclude :: time/001.php
3336
Original file line number Diff line number Diff line change 22
33use CodeIgniter \I18n \Time ;
44
5- $ myTime = new Time ('+3 week ' );
5+ $ myTime = new Time ('2024-01-01 ' );
6+ $ myTime = new Time ('2024-01-01 12:00:00 ' );
67$ myTime = new Time ('now ' );
8+ $ myTime = new Time ('+3 week ' );
You can’t perform that action at this time.
0 commit comments