Display date from Express object
Permalink 1 user found helpful
I'm running into a problem where i'm unable to display the date i entered in my Express Object attribute. Displaying strings and images work just fine.
I use the following to display the data:
I could use textfields (strings), but i'd really like to use the builtin date selector.
Could anyone explain me what i'm doing wrong?
'dateofbirth' => $employee->getEmployeeDateofbirth(),
I use the following to display the data:
'.$employee['dateofbirth'].'
I could use textfields (strings), but i'd really like to use the builtin date selector.
Could anyone explain me what i'm doing wrong?
The result of $employee->getEmployeeDateofbirth() is likely going to be a DateTime object. The DateTime object can't be displayed as is. You can use the format() method to format it as a string.
http://php.net/manual/en/datetime.format.php...
http://php.net/manual/en/function.date.php...
Example: