Hi friend,
        I never ued strftime function. I am confusing with the syntax.

        My problem is like this:

        I have the DATETIME in the variable $row->fromdate as YYYY-MM-DD
HH:MM:SS.
        

        Is it possible to convert it to DD/MM/YYYY HH:MM AM or PM using
strftime() function?


        //Is below code is correct

        $time=strftime([%a%b%C%d%I%p],$row->fromdate);

        echo '$time';

Thanks in advance.
Balaji



-----Original Message-----
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 12, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Hi How to convert the time from mysql(DATETIME) table
to the format DD/MM/YYYY HH:MM AM or PM in PHP?



> Hi,
>       I have stored the date and time in mysql table with DATETIME
type.
>
>       I want to change it in to DD/MM/YYYY HH:MM AM or PM.
>
>       How can I do this?

When you select the 'datetime' field from mysql use UNIX_TIMESTAMP().

Then in PHP use strftime() to format the 'datetime' field to your
liking.



-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Happiness isn't something you experience; it's something you remember.
                -- Oscar Levant
*/

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

**************************Disclaimer************************************
      


Information contained in this E-MAIL being proprietary to Wipro Limited
is 'privileged' and 'confidential' and intended for use only by the
individual or entity to which it is addressed. You are notified that any
use, copying or dissemination of the information contained in the E-MAIL
in any manner whatsoever is strictly prohibited.



 ********************************************************************

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

Reply via email to