PHP date_format() function with example

The date_format() function is a built-in function in PHP programming language. This funtion will return a new DateTime object and then format the date. In this post, I will share a PHP date_format() function with example.

Syntax:

Below is the Syntax of date_format() funtion in PHP code.

Example 1) strtotime() function

Outout:

2013/03/15 00:00:00

Example 2) Procedural style

2009-02-15

Example 3) Object oriented style

2009-02-15

Recommended Posts:


Prem Tiwari

An engineer by profession and a passionate blogger by heart. Founder of FreeWebMentor.com (A Programming blog for beginners), Tech Speaker at various forums. A part from this he is an open source enthusiast, WordPress Lover, Blogger, SEO, and Growth Strategic.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Solved Programs