note 58728 deleted from function.mktime by danbrown

From: Date: Sun, 20 Jul 2008 03:35:55 +0000
Subject: note 58728 deleted from function.mktime by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-142075@lists.php.net to get a copy of this message
Note Submitter: ian at opensystems dot net dot au ---- A trivial way to avoid having to remember the quirky order of variables. It's also more convenient to use because you can ignore the last three (time) variables if all you want to do is manupulate the date components. Just include the following function at the top of your script and call ansi_mktime instead of mktime. function ansi_mktime($y=0, $month=0, $d=0, $h=0, $min=0, $s=0){ return mktime($h, $min, $s, $month, $d, $y); } // eg: $day = 14; echo date("dS \d\a\y of M Y", ansi_mktime(2005, 11, $day + 7)) // output: 21st day of Nov 2005

« previous php.notes (#142075) next »