I want to get the yesterday date using specific date format in php this is the format:
$today = date("d.m.Y"); //15.04.2013
Is it possible?
Take consideration of month and years if they should be changed in respective.
I want to get the yesterday date using specific date format in php this is the format:
$today = date("d.m.Y"); //15.04.2013
Is it possible?
Take consideration of month and years if they should be changed in respective.
You can also do this using Carbon library:
In other formats:
try this
there you go
this will work also if month change
Yesterday Date in PHP:
If you define the timezone in your PHP app (as you should), which you can do this way:
Then it's as simple as:
(You may want to define a constant or environment variable to store your default timezone.)
try this