If you are looking how to pull up the previous day or month from current date, it is very easy to do it in php. Look at the following pieces of code.
This code will do the necessary conversions from one format to another.
$old_date = "05-Dec-2015"; $new_date = date("Y-m-d", strtotime($old_date) ); $prev_date = date("Y-m-d", strtotime('-3 days', strtotime($new_date)) ); // output: 2015-12-02
This code will return start and end days of previous month
$first = date('Y-m-d', strtotime("first day of -1 month")); $last = date('Y-m-d', strtotime("last day of -1 month"));
Mr. Balakrishnan is a World’s leading expert in citizenship and residence by investment schemes assisting wealthy individuals and families since 2010. He is the founder Best Citizenships (BC), CIP Journal and World Citizenship Council (WCC) .
His other interests include Linux servers, Machine learning, Blockchain/Cryptocurrencies, etc. He has a degree in Computer science engineering.