Re: date problem
| From: | R'twick Niceorgaw | Date: | Thu, 27 Feb 2003 21:55:44 +0000 |
| Subject: | Re: date problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137475@lists.php.net to get a copy of this message | ||
$date_array=explode("-",$newdate);
$day = $date_array[2];
$month = $date_array[1];
$year = $date_array[0];
Or,
$timestamp - strtotime($newdate);
$today = getdate($timestamp);
$month = $today['month'];
$mday = $today['mday'];
$year = $today['year'];
"Alexander Tsonev" <a_tsonev@contact.bg> wrote in message
news:20030227205728.92482.qmail@pb1.pair.com...
> Hello,
> I would ask you a question about date type
> if I have a variable from date type ($newdate) such as 2003-02-17
> how can I separate $newdate into 3 different variables? I want to create
> such variables:
> $day=17
> $month=2
> $year=2003
> I searched a lot, but I didn't find how to do this.
> I'll be very happy if someone helps!
>
> Thanks in advance, Alexander Tsonev
>
>
>
>