Dealing with mysql dates has always pissed me off. One of my co-workers let
me know about a tag they had laying around for that. What a code saver!

#mysqlDateTime(Now())#  or #mysqlDateTime(Form.Start_Date)#


<!--- THE FUNCTION --->

    <CFFUNCTION NAME="mysqlDateTime" RETURNTYPE="string">
        <CFARGUMENT NAME="DateTime" TYPE="string" REQUIRED="true">

        <CFif LEN(DateTime) GT 1>
            <CFset msDateTime="#DateFormat(DateTime,"yyyy-mm-dd")#
#TimeFormat(DateTime,"HH:mm:ss")#">
            <CFRETURN "#msDateTime#">
        <CFelse>
            <CFRETURN "NULL">
        </CFif>
    </CFFUNCTION>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248357
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to