slimphp / Slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
http://slimframework.com
MIT License
11.94k stars 1.95k forks source link

How to use Carbon with Slim #1725

Closed AviRns closed 8 years ago

AviRns commented 8 years ago

i have a method that returns date from oracle database. like return $this->sailpnos{'date_of_joining'}

how can the returned date instantiate a Carbon object so that i can use return $this->sailpnos{'date_of_joining'}->format('M j, Y');

Please help Thanks

juliangut commented 8 years ago

Try with

return Carbon::instance($this->sailpnos{'date_of_joining'})->format('M j, Y');
designermonkey commented 8 years ago

The above is a good example.

I would suggest that the best way to get answers to implementation questions like these are to join in the IRC channel where fellow Slim PHP users could offer advice or help.

Details can be found here https://github.com/slimphp/Slim/wiki/IRC-Chat