File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?php
22
3+ /**
4+ * This file is part of CodeIgniter 4 framework.
5+ *
6+ * (c) CodeIgniter Foundation <admin@codeigniter.com>
7+ *
8+ * For the full copyright and license information, please view
9+ * the LICENSE file that was distributed with this source code.
10+ */
11+
12+ use CodeIgniter \I18n \Time ;
13+
314/**
415 * This file is part of CodeIgniter 4 framework.
516 *
1526 /**
1627 * Get "now" time
1728 *
18- * Returns time () based on the timezone parameter or on the
29+ * Returns Time::now()->getTimestamp () based on the timezone parameter or on the
1930 * app_timezone() setting
2031 *
2132 * @param string $timezone
@@ -27,7 +38,7 @@ function now(?string $timezone = null): int
2738 $ timezone = empty ($ timezone ) ? app_timezone () : $ timezone ;
2839
2940 if ($ timezone === 'local ' || $ timezone === date_default_timezone_get ()) {
30- return time ();
41+ return Time:: now ()-> getTimestamp ();
3142 }
3243
3344 $ datetime = new DateTime ('now ' , new DateTimeZone ($ timezone ));
You can’t perform that action at this time.
0 commit comments