cachaito
1/23/2020 - 3:15 PM

Dates in PHP

<?php 
$DATE_FROM = date('Y-m-d'); 
$DATE_TO = date('Y-m-d', strtotime($DATE_FROM . "-30 days"));

$dateFrom = new DateTime();
$dateTo = new DateTime('now - 30 days');
// $dateTo->format('d-m-Y H:i:s');