> -----Original Message-----
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: 31 May 2002 10:58
> 
> Hi JJ,
> 
> > Is there a magical function that I can use to convert 4 
> > into April and 5 into May etc?
> > can I use mktime()
> > One yes no answer will do fine
> 
> Yes and no ;-)

Ha! I was just about to say exactly that myself!

> 
> You might want to use a combination of mktime() and date().
> 
> i.e.
> 
> <?php
>   $month = 4;
>   echo date ("jS F Y", mktime (1, 0, 0, $month, 1, 2002)); 
> ?>

Except, to get just the month (and leaving out optional arguments to mktime()), you 
would need:

    date('F', mktime(12, 0, 0, $month));

Also note I've specified 12:00, as opposed to 01:00, just to make sure you're well 
clear of any possible daylight-savings timeshifts!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to