Replies Back to Article
PHP MySQL Date Update
hello,
I downloaded the file (.mxp), I installed the extension tool and restarted my computer. But no added date format menu is available anywhere and I wonder how to use this tool ?
Thanks in advance for your reply
Isabelle

This extension alters the record insert and update behaviors so that your users can enter a date in almost any format and have it automatically changed to YYYY-MM-DD before inserting/updating into the database.
Greg
Hi Greg,
Thanks for the information you have provided..Great Job!!
Thanks..
This by chance doesn't let you put in date in European format dd-mm-yyyy?

Robert,
I am sorry you are having trouble with our extension, but we have tested it under MX 2004 and found no problems yet!
I am very curious to hear more about what happened to your file, so I can fix the problem. Have you tried an insert behaviour on a brand new page?
Also, on your previous question, are you storing dates in MySQL in that format?
By the way we are using this module without problems here in the United States. If there is a problem elsewhere, please let me know so I can fix it!
I am using this extension in the UK. The standard format in which we write dates is dd/mm/yy - in the states it appers to be mm/dd/yy. I have found it necessary to modify the code created by this extension when formatting the date value by replacing the line:
$theValue = ($theValue != "") ? "'" . date("Y-m-d",strtotime($theValue)) . "'" : "NULL";
with the line:
$theValue = ($theValue != "") ? "'" . date("Y-d-m",strtotime($theValue)) . "'" : "NULL";
in order to submit correctly - otherwise the month and the day get mixed up.
Is it possible to modify the extension so that when it installs it automatically check the local date settings and installs accordingly?

Chris and I are working on a solution...we are changing the underlying code and will hopefully have a solution in the next week or so.
Hi,
I also tried to use your extension but did not realy figure out how it works. I would need to format a german date (d.m.Y) to fit into the mySQL database.
If somebody has a hint I am very thankfull.
Greetings from Vienna.
Clemens

I am ok on the storage of the date format as 0000-00-00 but I seem to be having trouble disalaying a date from the db in any other format like 00-00-0000 (US style)
Any ideas?
-Danieo

Valerio,
Did you try the alternate version for EU? See the link above!
Greg

The extension uses strtotime to convert the string you entered into a timestamp. To view more info about this converter, see:
http://us3.php.net/manual/en/function.strtotime.php
Also, because strtotime() behaves according to GNU date syntax:
http://www.gnu.org/software/tar/manual/html_chapter/tar_7.html
Greg Olone
Stretched Out Software
I've installed the extension and still the dates don't insert into the database in proper format. Is there anything else I need to do?
Users input in format mm/dd/yyyy but the database shows 0000-00-00 00:00:00 on datetime fields and 0000-00-00 on date fields
Here's the code to insert:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "propertyNew")) {
$insertSQL = sprintf("INSERT INTO property_prp (listDate, availDate) VALUES (%s, %s)",
GetSQLValueString($_POST['listDate'], "date"),
GetSQLValueString($_POST['dateAvail'], "date"));
mysql_select_db($database_insight3, $insight3);
$Result1 = mysql_query($insertSQL, $insight3) or die(mysql_error());
I accidently voted 'poor' twice when I meant 'excellent'! Sorry about that.
I followed a link from your newsletter and found this extension - it was exactly what I needed for my current project. Thank you so much Greg!
I am trying to use this extension and seem to be having the same problem as everyone else here.
Entering the date 19/07/05 displays 2006-07-07.
I don't think the links provided about the converter adequately explain what else we need to change in order to get the correct display.
did you find a solution to this? I seem to be having the same problem.
Thanks
did you find a solution to this?
i seem to be having the same problem.
thanks