get yesterday dtae in php code example Example: php yesterday $yesterday = new DateTime('yesterday'); echo $yesterday->format('Y-m-d');