Welcome Guest, Not a member yet? Register   Sign In
Displaying Datetime field from DB returns string error
#1

Hello
I'm willing to display dates, saved in database as Datetime format.
Insert & Updates are working perfectly fine.
But when displaying and localizing this field with :
Code:
<?= $task->expired_at->toLocalizedString('d MMMM yyyy'); ?>
I'm getting the following error :
Call to a member function toLocalizedString() on string
Can anyone please help ?
Thank you
Reply
#2

It seems your $task->expired_at has a string value.

Check the Entity config.
See https://codeigniter4.github.io/CodeIgnit...e-mutators
Reply
#3

Many thanks @kenjis
That was exactly the issue !
Reply




Theme © iAndrew 2016 - Forum software by © MyBB