diff --git a/user_guide_src/source/libraries/time/002.php b/user_guide_src/source/libraries/time/002.php index 46b84050adc9..ebd5895d86b8 100644 --- a/user_guide_src/source/libraries/time/002.php +++ b/user_guide_src/source/libraries/time/002.php @@ -1,3 +1,5 @@ toLocalizedString('MMM d, yyyy'); // March 9, 2016 diff --git a/user_guide_src/source/libraries/time/016.php b/user_guide_src/source/libraries/time/016.php index 0645fd9b49ce..fe67508a4743 100644 --- a/user_guide_src/source/libraries/time/016.php +++ b/user_guide_src/source/libraries/time/016.php @@ -1,5 +1,7 @@ toDateTimeString(); // 2016-03-09 12:00:00 diff --git a/user_guide_src/source/libraries/time/017.php b/user_guide_src/source/libraries/time/017.php index c0283d9d2e90..6047929bd310 100644 --- a/user_guide_src/source/libraries/time/017.php +++ b/user_guide_src/source/libraries/time/017.php @@ -1,5 +1,7 @@ toDateString(); // 2016-03-09 diff --git a/user_guide_src/source/libraries/time/018.php b/user_guide_src/source/libraries/time/018.php index d3001a7749f4..b53dd96999c3 100644 --- a/user_guide_src/source/libraries/time/018.php +++ b/user_guide_src/source/libraries/time/018.php @@ -1,5 +1,7 @@ toTimeString(); // 12:00:00 diff --git a/user_guide_src/source/libraries/time/019.php b/user_guide_src/source/libraries/time/019.php index 50088537061c..cc355921289d 100644 --- a/user_guide_src/source/libraries/time/019.php +++ b/user_guide_src/source/libraries/time/019.php @@ -1,5 +1,7 @@ getYear(); // 2016 -echo $time->getMonth(); // 8 -echo $time->getDay(); // 12 -echo $time->getHour(); // 16 -echo $time->getMinute(); // 15 -echo $time->getSecond(); // 23 +// The output may vary based on locale. +echo $time->getYear(); // '2016' +echo $time->getMonth(); // '8' +echo $time->getDay(); // '12' +echo $time->getHour(); // '16' +echo $time->getMinute(); // '15' +echo $time->getSecond(); // '23' -echo $time->year; // 2016 -echo $time->month; // 8 -echo $time->day; // 12 -echo $time->hour; // 16 -echo $time->minute; // 15 -echo $time->second; // 23 +echo $time->year; // '2016' +echo $time->month; // '8' +echo $time->day; // '12' +echo $time->hour; // '16' +echo $time->minute; // '15' +echo $time->second; // '23' diff --git a/user_guide_src/source/libraries/time/021.php b/user_guide_src/source/libraries/time/021.php index a3e0f128c5d7..fb384942c7f7 100644 --- a/user_guide_src/source/libraries/time/021.php +++ b/user_guide_src/source/libraries/time/021.php @@ -1,17 +1,20 @@ getDayOfWeek(); // 6 - but may vary based on locale's starting day of the week -echo $time->getDayOfYear(); // 225 -echo $time->getWeekOfMonth(); // 2 -echo $time->getWeekOfYear(); // 33 -echo $time->getTimestamp(); // 1471018523 - UNIX timestamp -echo $time->getQuarter(); // 3 +// The output may vary based on locale. +echo $time->getDayOfWeek(); // '6' +echo $time->getDayOfYear(); // '225' +echo $time->getWeekOfMonth(); // '2' +echo $time->getWeekOfYear(); // '33' +echo $time->getTimestamp(); // 1471018523 - UNIX timestamp (locale independent) +echo $time->getQuarter(); // '3' -echo $time->dayOfWeek; // 6 -echo $time->dayOfYear; // 225 -echo $time->weekOfMonth; // 2 -echo $time->weekOfYear; // 33 +echo $time->dayOfWeek; // '6' +echo $time->dayOfYear; // '225' +echo $time->weekOfMonth; // '2' +echo $time->weekOfYear; // '33' echo $time->timestamp; // 1471018523 -echo $time->quarter; // 3 +echo $time->quarter; // '3' diff --git a/user_guide_src/source/libraries/time/022.php b/user_guide_src/source/libraries/time/022.php index facfdc5a9d02..deda59e0b0c3 100644 --- a/user_guide_src/source/libraries/time/022.php +++ b/user_guide_src/source/libraries/time/022.php @@ -1,5 +1,7 @@ getAge(); // 5 diff --git a/user_guide_src/source/libraries/time/023.php b/user_guide_src/source/libraries/time/023.php index 970aaad45d76..9f0b0803eda4 100644 --- a/user_guide_src/source/libraries/time/023.php +++ b/user_guide_src/source/libraries/time/023.php @@ -1,4 +1,6 @@ getDst(); // false echo Time::createFromDate(2012, 9, 1)->dst; // true diff --git a/user_guide_src/source/libraries/time/024.php b/user_guide_src/source/libraries/time/024.php index 1919e1d097cf..ab73eb62cb0b 100644 --- a/user_guide_src/source/libraries/time/024.php +++ b/user_guide_src/source/libraries/time/024.php @@ -1,4 +1,6 @@ getLocal(); // true -echo Time::now('Europe/London'); // false +use CodeIgniter\I18n\Time; + +echo Time::now()->getLocal(); // true +echo Time::now('Europe/London')->local; // false diff --git a/user_guide_src/source/libraries/time/025.php b/user_guide_src/source/libraries/time/025.php index b25d5de4aef9..50b14fdc507f 100644 --- a/user_guide_src/source/libraries/time/025.php +++ b/user_guide_src/source/libraries/time/025.php @@ -1,4 +1,6 @@ getUtc(); // false echo Time::now('UTC')->utc; // true diff --git a/user_guide_src/source/libraries/time/026.php b/user_guide_src/source/libraries/time/026.php index 030102f72d70..2aff6825c8fd 100644 --- a/user_guide_src/source/libraries/time/026.php +++ b/user_guide_src/source/libraries/time/026.php @@ -1,5 +1,7 @@ getTimezone(); $tz = Time::now()->timezone; diff --git a/user_guide_src/source/libraries/time/027.php b/user_guide_src/source/libraries/time/027.php index dde3a39bec92..666bbd2798e2 100644 --- a/user_guide_src/source/libraries/time/027.php +++ b/user_guide_src/source/libraries/time/027.php @@ -1,4 +1,6 @@ getTimezoneName(); // America/Chicago echo Time::now('Europe/London')->timezoneName; // Europe/London diff --git a/user_guide_src/source/libraries/time/029.php b/user_guide_src/source/libraries/time/029.php index d65f408fe05d..fbff5ab5fe98 100644 --- a/user_guide_src/source/libraries/time/029.php +++ b/user_guide_src/source/libraries/time/029.php @@ -1,5 +1,7 @@ setTimezone('Europe/London'); // Returns new instance converted to new timezone diff --git a/user_guide_src/source/libraries/time/030.php b/user_guide_src/source/libraries/time/030.php index 243416cbbdb5..1e22876e9883 100644 --- a/user_guide_src/source/libraries/time/030.php +++ b/user_guide_src/source/libraries/time/030.php @@ -1,5 +1,7 @@ setTimestamp(strtotime('April 1, 2017')); diff --git a/user_guide_src/source/libraries/time/032.php b/user_guide_src/source/libraries/time/032.php index 9207945c5242..ce6490e3243a 100644 --- a/user_guide_src/source/libraries/time/032.php +++ b/user_guide_src/source/libraries/time/032.php @@ -1,5 +1,7 @@ difference(Time::now()); diff --git a/user_guide_src/source/libraries/time/039.php b/user_guide_src/source/libraries/time/039.php index 12cc3d638f2c..9c31042b668b 100644 --- a/user_guide_src/source/libraries/time/039.php +++ b/user_guide_src/source/libraries/time/039.php @@ -1,5 +1,7 @@