CodeIgniter Forums
Deprecate now() helper - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31)
+--- Thread: Deprecate now() helper (/showthread.php?tid=82809)



Deprecate now() helper - kenjis - 08-25-2022

I would like to deprecate now() helper.

It seems now() with a timezone returns unexpected or confusing result.
See https://forum.codeigniter.com/showthread.php?tid=82808

CI4 has the Time class. We don't need to use now().


RE: Deprecate now() helper - InsiteFX - 08-26-2022

now() was being used to set the MySQLi datetime and timestamp in the database.

But I'm sure we can work around this, if you want to remove it.


RE: Deprecate now() helper - kenjis - 08-26-2022

Do you use the Date helper `now()` in your code?
If so, do you use the timezone parameter?


RE: Deprecate now() helper - InsiteFX - 08-27-2022

Orginally the helper now() was not in the new CI so I created a method to just return the date time.