having problem printing out "created_at" date |
(09-06-2021, 06:58 AM)chakycool Wrote: Tried this and I get a error " Call to a member function getTime() on null" Other alternative for humanize: Code: echo $item->created_at; // this should work out , print_r will print it property
Thanks ikesela for the suggestion but I still get the same error as before.
"Call to a member function getTime() on null" "created_at" is not just a string when is comes out via Ci4.
You can use the TimeDifference class
PHP Code: $time = $item->created_at; // instance of Time
Hi Paul, thanks for the suggestion but I found the issue.
Everybody who specify the "public $appTimezone" make sure it's in camel case. I had it all in lower case and all worked but the Humanization. Example : public $appTimezone = 'America/Chicago';
you should post your entity class here. something not right with your code maybe. since i test on my entity class for created_at, it work perfectly.
|
Welcome Guest, Not a member yet? Register Sign In |