----- Original Message -----
From: "Daniele Iachini" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 28, 2001 6:50 PM
Subject: Help w/MySQL and Dreamweaver Ultradev


> I'm not able to manage dates correctly in dreamweaver, expecially when a
> form with dates is submitted to update a record.
> The singular yyyy-mm-dd format of MySQL in fact is correctly put in
> dd/mm/yyyy (that's ok for my country and is my locale) but when i submit
the
> form, even without changes, it isn't recognised any more by MySQL that
> zeroes the field or tries to read it a non inverted yyyy-mm-dd (obviously
> corrupted). Anyone knows a solution or knows the syntax of DoDateTime()
> function that seems to be a possible solution?
> Is there a place in internet where I can find a complete reference of ASP
> command and functions syntax???

I always cringe when I think about the ASP code that is produced by the
Macromedia products. However, this problem can be easily solved with an ASP
function that you can add to your pages (I would recommend putting it in an
include file, but that's just me).

As far as I know, none of the options within the FormatDateTime function
will format the date to the YYYY-MM-DD format used by MySQL (and Oracle too,
btw). Therefore, use the following function:

<%
Function MakeDate(strDate)
'Written by Dennis Salguero

If IsDate(strDate) Then
    Dim m
    Dim d
    Dim y
    m = Month(strDate)
    d=Day(strDate)
    y=Year(strDate)
    MakeDate = y & "-"& m & "-" & d
Else
    MakeDate = strDate
End If

End Function
%>

As you can see, this function is very straightforward. It simply breaks down
the date you pass into different components and formats it to fit a
YYYY-MM-DD format, which is understood by MySQL.

Good Luck,

Dennis
**********************************************
Beridney Computer Services
http://www.beridney.com



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to