If you're workin with a Model: Take a look at Mutators
With mutators you can create a method in your Model:
public function setDateAttribute($value)
{
$this->attributes['date'] = 'convertion rules';
}
If not, see Carbon createFromFormat method.
First parse your date field as Carbon object.
$createdAt = Carbon::parse(your_date);
Then you can use
$date = $createdAt->format('M d Y');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community