Welcome Guest, Not a member yet? Register   Sign In
having problem printing out "created_at" date
#6

(This post was last modified: 09-06-2021, 04:10 AM by ikesela.)

(09-05-2021, 11:44 PM)chakycool Wrote: $item to array didn't make things better.

Array ( [menu_id] => 26 [comp_id] => 20002 [name] => Appetizers [image] => 20210905162616247.jpg [edited_by] => 0 [created_at] => CodeIgniter\I18n\Time Object ( [timezone:protected] => DateTimeZone Object ( [timezone_type] => 3 [timezone] => xx/xx) [locale:protected] => en-ae [toStringFormat:protected] => yyyy-MM-dd HH:mmConfuseds [date] => 2021-09-05 16:25:34.000000 [timezone_type] => 3 [timezone] => xx/xx) [updated_at] => CodeIgniter\I18n\Time Object ( [timezone:protected] => DateTimeZone Object ( [timezone_type] => 3 [timezone] => xx/xx) [locale:protected] => en-ae [toStringFormat:protected] => yyyy-MM-dd HH:mmConfuseds [date] => 2021-09-05 16:26:17.000000 [timezone_type] => 3 [timezone] => xx/xx ) )

Thank you guys for the recommendations but I want to do this is the new CI4 way with entities. Hope I get a CI4 way to solve this.

Its not CI4 , but your entities that cast time to I18n\Time  object. so

$item->created_at must be an instance of   CodeIgniter\I18n\Time()

check your entiti at this variable: protected $casts =
Reply


Messages In This Thread
RE: having problem printing out "created_at" date - by ikesela - 09-06-2021, 04:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB