How to convert to a specific date format in PHP?

Date is something which could be represented or described in many different ways. For Instance the date today could be represented in the following ways-

20th March 2018




And so on

So, it is Important to know how would one convert from one format to another.

The first thing to do is set a default date format.



Then if you want the output of the date to be as month/day/year



This statement can be modified to the format that you require.

You need to pay attention to the characters that are used to describe the dates, they are case sensitive.

This would give you a detailed explanation on the characters and their description.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s