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

webfuelcode's avatar

Date format on update form box

Trying to show the old date on an update form text box.

Below is what I have.

<input type="text" class="form-control" name="expires" id="datepicker" placeholder="Enter coupon expiry date" value="{{old('expires', $post->expires->format('Y.m.d'))}}">

Date format should be in Y-m-d not like Y.m.d

0 likes
1 reply
Pixelairport's avatar

And what error is thrown when you write Y-m-d? Or what is the problem? Does Y-m-d not work? I mean like that:

$post->expires->format('Y-m-d')

Please or to participate in this conversation.