Solved

dateformat not working quite right

Posted on 2003-11-09
2
337 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now