Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

dhondi_kalyan's avatar

How to save Date And Time in mysql DB

Hi,

How to save the date and time in mysql DB in laravel 4.2.

0 likes
6 replies
rikarsen's avatar
Schema::create('foo', function($table)
{
    $table->timestamps();
});
dhondi_kalyan's avatar

Thanks For repond. I that way iam unable to save date and time in DB the rest of values are saving in db, But only Date And Time are not saving

bashy's avatar

I would use Carbon to do date stuff. Carbon::now() can be used to input timestamp.

JarekTkaczyk's avatar
Level 53

@dhondi_kalyan Show the example of what's not being saved. Maybe the field is not fillable, maybe you're not passing it to the save method, maybe... Be specific to get serious answer.

Please or to participate in this conversation.