note 87691 modified in function.getdate by danbrown

From: Date: Wed, 17 Dec 2008 16:34:41 +0000
Subject: note 87691 modified in function.getdate by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-148270@lists.php.net to get a copy of this message
Here is another gmgetdate that is a little faster/suscint (no loops). <?php function gmgetdate2($ts = null){ $k = array('seconds','minutes','hours','mday', 'wday','mon','year','yday','weekday','month',0); return(array_combine($k,split(":", gmdate('s:i:G:j:w:n:Y:z:l:F:U',is_null($ts)?time():$ts)))); } ?> It also returns the values in the same order as getdate. --was-- Here is another gmgetdate that is a little faster/suscint (no loops). <? function gmgetdate2($ts = null){ $k = array('seconds','minutes','hours','mday', 'wday','mon','year','yday','weekday','month',0); return(array_combine($k,split(":", gmdate('s:i:G:j:w:n:Y:z:l:F:U',is_null($ts)?time():$ts)))); } ?> It also returns the values in the same order as getdate. http://php.net/manual/en/function.getdate.php

« previous php.notes (#148270) next »