Re: Date question?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If i have a date in the form 'Nov 11 2011 12:00AM' how can i show the date
as mm/dd/yy and time as 12:00:00

help is appreciated.

Thanks,

Regards
----- Original Message -----
From: "malte" <der_diggen@gmx.net>
To: <php-windows@lists.php.net>
Sent: Friday, September 12, 2003 2:16 PM
Subject: Re:  Date question?


> you also can do
>
> <?
> $date_as_string = "2003-04-02";
>
> $temp = explode("-", $date_as_string); // Cuts your String at '-' and
stores
> it in the $temp - Array
>
> $date_as_timestamp = mktime(1,0,0,$temp[1], ($temp[2]+9), $temp[0]); //
> contains the timestamp to the date 9 Months ahead
>
> echo date("Y-j-n", $date_as_timestamp); // puts out the date in this form:
> Year-Days-Month
> ?>
>
> check out date() and mktime() in the php manual... oh yeah and i supposed
> 2003-04-02 to mean February 4th 2003 if i'm wrong you have to change the
> mktime line..
>
> ----- Original Message -----
> From: "Disko_kex" <disko_kex@swedish-mushroom.com>
> To: <php-windows@lists.php.net>
> Sent: Friday, September 12, 2003 3:50 PM
> Subject:  Date question?
>
>
> > Hi
> >
> > If I have a date (2003-04-02) and want to select 9 months later, how to
> > do?
> >
> > Thanks.
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux