How to change date format in PHP

1

- Advertisement -

In this tutorial we will learn how to chnage the date format in PHP.
In this tutorial we will use strtotime() and date() funtion.
The strtotime() funtion used to convert an English textual date-time description to a UNIX timestamp.We can return the English textual date-time in date format using the date() function.

Change dd/mm/yyyy to yyyy-mm-dd

Output

2019-09-18

Change yyyy-mm-dd to dd-mm-yyyy

Output

18-09-2019

Change yyyy-mm-dd to mm-dd-yyyy

Output

09-18-2019

- Advertisement -

Leave A Reply

Your email address will not be published.

1 Comment
  1. Shamim Akhtar Sheikh says

    Please Post How to upload a video in database using php?

Leave A Reply

Your email address will not be published.