On Tuesday 01 April 2003 17:49, Justin French wrote:
> on 01/04/03 9:16 PM, Diana Castillo ([EMAIL PROTECTED]) wrote:
> > how do you get just the month (in numeric format ) of a specific date.
> > (not today)
> > same for day and year.  The date is in yyyy-dd-mm format to start with.
> > thanks.
>
> If your date was yyyy-mm-dd, you could do this:
>
> <?
> $date = '2002-03-18';
> echo date('m', strtotime($date));
> ?>
>
> But, because yours isn't:
>
> <?
> $date = '2002-03-18';
> list($y,$d,$m) = explode('-',$date);
> echo date('m', strtotime("{$y}-{$m}-{$d}"));
> ?>

I don't want to be awkward, but wouldn't $m be holding the required info 
already? -- ignoring the fact that you have an invalid date.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
What would you expect to gain from XIP besides being buzzword
compliant?

        - Erik Mouw on linux-arm-kernel
*/


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

Reply via email to