[thelist] PHP date month list...?

Tris beertastic at gmail.com
Thu Feb 15 06:04:33 CST 2007


Nice..!
cheers!

On 15/02/07, Jens Brueckmann <jens.brueckmann at gmail.com> wrote:
> Hi Tris,
>
> > Why doesn't this 'function' output a list of months?
> >
> > for ($h = 1; $h <= 12; $h++) {
> >         $monthNo = date("m", $h);
> >         $monthName = date("M", $h);
> >         $flightdateListMonth .= "<option value=\"" . $monthNo . "\">" .
> > $monthName . "</option>";
> > }
> >
> > Hmmmm... I know I'm missing something obvious...
>
> The date function requires a timestamp as second argument. This should work:
>
>    $monthNo   = date("m", mktime(0, 0, 0, $h, 1, 0));
>    $monthName = date("M", mktime(0, 0, 0, $h, 1, 0));
>
> Cheers,
>
> jens
> --
> Jens Brueckmann
> http://www.yalf.de
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


-- 
When a person can no longer laugh at himself, it is time for others to
laugh at him.
Thomas Szasz



More information about the thelist mailing list