RE: [PHP] Hi How to convert the mysql(DATETIME) time to the format DD/MM/YYYY HH:MM AM or PM using PHP?
| From: | Balaji Ankem | Date: | Tue, 12 Mar 2002 11:43:10 +0000 |
| Subject: | RE: [PHP] Hi How to convert the mysql(DATETIME) time to the format DD/MM/YYYY HH:MM AM or PM using PHP? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88181@lists.php.net to get a copy of this message | ||
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:php-general@gremlins.com.hk]
Sent: Tuesday, March 12, 2002 4:09 PM
To: php-general@lists.php.net
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. ********************************************************************
**************************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. ********************************************************************