RE: [PHP] FormatDateTime in PHP
| From: | Adrian Portsmouth | Date: | Tue, 25 Feb 2003 10:15:14 +0000 |
| Subject: | RE: [PHP] FormatDateTime in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137065@lists.php.net to get a copy of this message | ||
No don't use the PHP date function, MySQL has an inbuilt function
exactly for this.
See DATE_FORMAT http://www.mysql.com/doc/en/Date_and_time_functions.html
HTH
Adrian
www.phpscriptsearch.com
-----Original Message-----
From: Chris Hayes [mailto:chayes@antenna.nl]
Sent: 25 February 2003 12:32
To: php-general@lists.php.net
Subject: Re: [PHP] FormatDateTime in PHP
At 13:25 25-2-03, you wrote:
>Please,
>
>How do I make to format my date in the my format? For Example:
you forgot to tell how the date in the database is formatted, that is
quite
important.
did you read the php manual on date() ?
http://www.php.net/manual/en/function.date.php
>## I filter
>$filter = " SELECT DTVECTO FROM CLIENTS";
>$result = mysql_query($filter);
>$rows = mysql_num_rows($result);
>while($rows = mysql_fetch_array($result)) {
> ## I get date to the data base
> $my_date = $rows["DTVECTO"];
> ## I print
> print($my_date);
>}
>
>I want to show my date in format: 01/12/2003 (dd/mm/yyyy).
>For Example
>Date Value
>01/09/2003 $ 50.00
>01/10/2003 $ 60.00
>01/11/2003 $ 70.00
>
>
>
>thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php