Ask a Question related to PHP Development, Design and Development.
-
Binay Agarwal #1
Re: [PHP] converting date into database date format(newbie)
Hi!
U can convert "8-Aug-03" into mysql date which requires yyyy-mm-dd format as
below.
<?php
date("Y-m-d",strtotime("8-Aug-03"));
?>
Hope this helps and let me know.
Cheers
Binay
----- Original Message -----
From: "Anil Garg" <anilg@niksun.com>
To: <php-general@lists.php.net>
Sent: Friday, August 29, 2003 11:01 AM
Subject: [PHP] converting date into database date format(newbie)
writing> Hi,
>
> I am a newbie to php.
>
> I am reading date in the format "08-Aug-03" from a text file. While> this date into the myqsl database's date column it shows '00-00-0000'.
> Is there a function or some other way to convert "08-Aug-03" type of dates
> in to format which is acceptable by date field of the mysql database.
>
> Thanks and regards
> Anil.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>Binay Agarwal Guest
-
How to export database date to Csv format
I am using MS Access. Please show me how to export databse date to CSV format. Thanks -
Converting Date Formats?
Howdy! I have some dates in a MySQL database that are in a 'Y-m-d' format. Is there a way to have PHP read these dates and convert them to a... -
Date format Help.
I have a field set to short date 99;99;00;0, and it appears as soon as I tab to the next couple of fields that the previous date field changes to... -
Converting raw numbers to written date
How would you decipher a stamp like 12303 Is it 1/23/03 or 12/3/03 ------------------------------------------------- d l b j r Unambit... -
Converting Date
In PHP with MySQL: My table stores the date as 2003/10/07 ... (year, day, month). I want to be able to convert it to 07/10/2003 before I echo it... -
Anil Garg #2
converting date into database date format(newbie)
Hi,
I am a newbie to php.
I am reading date in the format "08-Aug-03" from a text file. While writing
this date into the myqsl database's date column it shows '00-00-0000'.
Is there a function or some other way to convert "08-Aug-03" type of dates
in to format which is acceptable by date field of the mysql database.
Thanks and regards
Anil.
Anil Garg Guest
-
John W. Holmes #3
Re: [PHP] converting date into database date format(newbie)
Anil Garg wrote:
MySQL expects it's date in a YYYY-MM-DD or YYYYMMDD format. Try using> I am reading date in the format "08-Aug-03" from a text file. While writing
> this date into the myqsl database's date column it shows '00-00-0000'.
> Is there a function or some other way to convert "08-Aug-03" type of dates
> in to format which is acceptable by date field of the mysql database.
soething like this:
$mysql_date = date('Ymd',strtotime($date_from_text_file));
--
---John Holmes...
Amazon Wishlist: [url]www.amazon.com/o/registry/3BEXC84AB3A5E/[/url]
php|architect: The Magazine for PHP Professionals – [url]www.phparch.com[/url]
John W. Holmes Guest



Reply With Quote

