Solved

dateformat not working quite right

Posted on 2003-11-09
2
354 Views
Last Modified: 2013-12-24
value="<CFOUTPUT>#DateFormat(Now(),"mm/dd/yyyy")#</CFOUTPUT>"

this looks perfect in the form field. but in my mysql database i'm getting this (instead of 11/9/2003):

9/20/2011 3:00:00 AM

the field in the database is set to datetime format.  any ideas??
0
Comment
Question by:phillystyle123
  • 2
2 Comments
 
LVL 12

Expert Comment

by:jyokum
ID: 9710813
how are you inserting it into the database?
0
 
LVL 12

Accepted Solution

by:
jyokum earned 75 total points
ID: 9710823
should be using CFQUERYPARAM. something like

INSERT INTO tablename (dateColumn)
VALUES (<cfqueryparam value="#now()#" cfsqltype="cf_sql_timestamp">)
0

Featured Post

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question