note 99601 modified in function.strtotime by danbrown

From: Date: Thu, 26 Aug 2010 14:34:49 +0000
Subject: note 99601 modified in function.strtotime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-172092@lists.php.net to get a copy of this message
One liner to get end of financial year (EFY) <?php $efy = ($efy = mktime(0,0,0,7,1,date('Y'))) > time() ? --$efy:strtotime('+1 year', --$efy); echo date('d/m/y H:i:s',$efy); // 30/06/11 23:59:59 ?> I use 1 July as the test date, so it should work if you run it at say 11.59pm June 30. Should be right, ymmv. --was-- One liner to get end of financial year (EFY) $efy = ($efy = mktime(0,0,0,7,1,date('Y'))) > time() ? --$efy:strtotime('+1 year', --$efy); echo date('d/m/y H:i:s',$efy); // 30/06/11 23:59:59 I use 1 July as the test date, so it should work if you run it at say 11.59pm June 30. Should be right, ymmv. http://php.net/manual/en/function.strtotime.php

« previous php.notes (#172092) next »