Browsing:

Tag: date format php

How do I Convert Date Format in PHP

Hello friends, We uses PHP strtotime() and date() functions to convert date format in php. For example we have stored a date YYYY-MM-DD format in a variable and need to change this to MM-DD-YYYY format. We can achieve this by converting date first to seconds using strtotime() function. After that reconstruct date to any format using date() function. Examples are below 1. Change YYYY-MM-DD => MM-DD-YYYY Here we have date Read more…