Replies Back to Article

PHP MySQL Date Update

How to use this new behavior ?
May 23, 2003 by perissat isabelle

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

RE: How to use this new behavior ?
May 23, 2003 by Greg Olone

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

Date Update Extensions
May 29, 2003 by priya var

Hi Greg,

Thanks for the information you have provided..Great Job!!

Thanks..

 

RE: RE: How to use this new behavior ?
October 2, 2003 by Kent Livingston
Are you are saying that you don't do anything with behaviors this acts automatically in edit/update foms? 
format
February 15, 2004 by Robert Brown

This by chance doesn't let you put in date in European format dd-mm-yyyy?

 

RE: How to use this new behavior ?
February 16, 2004 by Greg Olone
Yes.
DO NOT INSTALL THIS MODULE!!!!
February 20, 2004 by Robert Brown
After installing it myself my dreamweaver mx 2004 has a total fit with record insertion. I lose the ability to see the record insertion behavior in the behaviors menu. Thus I loose the ability to edit record insertion params in general. All because this module puts an extra if in the dreameaver get mysql strings function for checking dates. This then permanently confuses dreamweaver that the record insertion is not there. Mind you this module doesn't except European Dates either.
RE: DO NOT INSTALL THIS MODULE!!!!
February 20, 2004 by Greg Olone

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!

UK date format
March 2, 2004 by Chris Malloch

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?

RE: UK date format
March 2, 2004 by Greg Olone

Thanks for the info...I'll look into it and see!

Not working
March 10, 2004 by matt furnell
I am using this extension in the uk and have amended the "Y-m-d" to "Y-d-m" as previously stated.  Even with this a date such as 25/05/04 and 30/05/04 is getting entered into the database date fields as 1/5/2006 and 6/5/2006 respectively.  Please could you point out where i am going wrong??
RE: Not working
March 10, 2004 by Greg Olone

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.

German Date Format
March 12, 2004 by - -

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

Date formatted for display
April 15, 2004 by Daniel Hovis

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

 

is not working at all...
June 8, 2004 by Valerio Fioretti
...I've installed it... made a form with a date field, sending date value to the db. The db table has, of course, a DATE place... but the only things I get is 0000-00-00 Why...? Is there a way to use it? I would like to enter the date in EU format (dd-mm-yy) and put it in... Please help!
RE: is not working at all...
June 8, 2004 by Greg Olone

Valerio,

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

Greg

Not working fully & screws up time
August 11, 2004 by Chris Alexander
After installing this extension, I noticed the date would insert correctly only some ways you enter it, if you enter the date as 09-02-2004 it gets messed up & inserted as 2015-03-27. Also this totally screws up any fields you set as Time in mySQL. Now anything I type for time ex. 9:00 or 16:00 always shows up as 00:20:04. I hope this thing will un-install...
RE: Not working fully & screws up time
August 12, 2004 by Greg Olone

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

What am I doing wrong?
February 3, 2005 by Lawrence Bunnell

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());

Great extension
March 11, 2005 by Dorothy Ryan

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!

Trying to use to fix MXWidgets...
March 12, 2005 by Eric Guerin
I am trying to use this to fix the formatting from Interakts MXWidget Calender tool, but it doesn't seem to be working, how do a force a rewrite of the Update/Insert record command so the new code from this extension is working? Could MXWidget conflict with this extension somehow?
Where am I going wrong?
July 19, 2005 by kate green

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.

RE: Trying to use to fix MXWidgets...
July 19, 2005 by kate green

did you find a solution to this? I seem to be having the same problem.

Thanks

RE: What am I doing wrong?
July 19, 2005 by kate green

did you find a solution to this?

i seem to be having the same problem.

thanks