Home > Software design >  Laravel how to show date by 24hr time
Laravel how to show date by 24hr time

Time:11-10

I have a date column in my project which I need to display it in 24hr time

html input

<input type="datetime-local" name="registered">

how I am displaying it

<p> {{ Carbon\Carbon::parse($user->registered)->format('d-m-Y h:i:s') }} </p>

SQL Structure

    registered  timestamp           No  current_timestamp()     ON UPDATE CURRENT_TIMESTAMP()

how can I change it please?

CodePudding user response:

https://www.w3schools.com/php/php_date.asp

H - 24-hour format of an hour (00 to 23)

<p> {{ Carbon\Carbon::parse($user->registered)->format('d-m-Y H:i:s') }} </p>
  • Related