Re: mySQL date converting
| From: | Bjorn Van Simaeys | Date: | Tue, 07 Aug 2001 20:56:17 +0000 |
| Subject: | Re: mySQL date converting | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61704@lists.php.net to get a copy of this message | ||
Hi,
You could write a PHP script to get all the current
values (I presume that you've put varchar as
datatype), parse them with string functions and
convert it in the way you'd like them to be. All this
is not so difficult to make.
I prefer to store my date/times in the UNIX timestamp
form. I use an int(10) field in mySQL database
(int(10) means an integer with 10 digits, this way I
can store more than 331 years!). This is easy to sort
and to calculate with too. In your development you can
use this timestamp and format it in any way you want
it using the date() function.
You'll find all references in the php.net manual.
Greetz,
Bjorn Van Simaeys
www.bvsenterprises.com
--- Christopher CM Allen <callen@driver8.org> wrote:
> Greetings:
>
> I have a field entry in a MYQSL table that stores
> the date as:
> August 02, 2001 :(
>
> Is there anyway to convert this to 08-02-2001
> outside of the table via php?
>
> Better yet is there ayway I can go back into my
> table and change these dates
> into a better format for computation?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-general-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/