That looks fine. I wonder if you’ve got something configured somewhere that’s altering how it’s parsing date strings, due to locale or the like. You shouldn’t need to jump through all the hoops you’re doing to get to a formatted date. What does $employee->date_born->year give you? $employee->date_born->format('Y-m-d')?
thank you it works with this
$employee->date_born->format(‘Y-m-d’)
before I use this $this->tgl_indo(date_format(date_create($employee->date_born), ‘Y-m-d’))
that tgl_indo is the function to make format date in my country
so I change to $this->tgl_indo($employee->date_born->format(‘Y-m-d’))