vendredi 11 mars 2016

Issue while getting start and end date of current Year

I searched a lot on Google to get the start and end date of the current year. Now, After 2 hours of search, posted the query here.

Below is what i have tried so far. but not working.

$date = date('Y-m-d');
$startDate = new \DateTime($date);
$endDate = new \DateTime($date);
$endDate->modify("+1 day -1 second");

can you please guide me in right direction ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire