Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Coldfusion MySQL Date Issue

Posted on 2004-09-23
11
Medium Priority
?
271 Views
Last Modified: 2013-12-24
Okay, heres all the facts to make sure things are understood. I live in Australia, so date format is dd/mm/yyyy. I ensure that the date format is dd/mm/yyyy for entry purposes, but then in the sql I enter #DateFormat(form.datefield,"yyyy-mm-d"). As long as my date is any day over 12 it puts it into the MySQL database properly. If for example, I enter 10/09/1979 (10th of September 1979) it will for some reason swap the month and the day so that its 09/10/1979 in mysql. However if I enter 25/09/1979 it enters it into the database as 25/09/1979. Any ideas? Whatever it is doing, it happens either in #Dateformat(form.datefield,"yyyy-mm-d") or in MySQL.
0
Comment
Question by:wulfshayde
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
11 Comments
 
LVL 21

Accepted Solution

by:
pinaldave earned 400 total points
ID: 12139075
try this #createodbcdate(DateFormat(form.datefield,"yyyy-mm-d"))#
0
 
LVL 4

Author Comment

by:wulfshayde
ID: 12139114
Okay, Ive just noticed that its the coldfusion dateformat doing it, it error'd on that and showed the date as 1979-10-09 even though I entered it in as 10/09/1979(d/mm/yyyy)
0
 
LVL 4

Author Comment

by:wulfshayde
ID: 12139149
Skip it, it was something stupid. I needed to use LSDateFormat rather than DateFormat. Can I give 100 points to pinaldave for his help and have the rest of my point PAQ'd?
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 21

Expert Comment

by:pinaldave
ID: 12139215
Hi wulfshayde,
yes you can do this. you have to post question in the  community support http://www.experts-exchange.com/Community_Support/
Regards,
---Pinal
0
 
LVL 17

Assisted Solution

by:Tacobell777
Tacobell777 earned 400 total points
ID: 12139345
actually the best bet is to ALWAYS use createDate() it creates a date object that every function understands and no locale issues...

Where in Oz are you?
Im in Brisbane...
0
 
LVL 17

Expert Comment

by:Tacobell777
ID: 12139356
This will also assist you if you ever need to convert the website to use other locales, like US etc..

I am working on a HP site that needs to support multiple languages (locales) and I convert every date to a date object with createDate( year, month, day )
0
 
LVL 4

Author Comment

by:wulfshayde
ID: 12156185
@Tacobell777

I am in Darwin and Working on the Perkins Shipping Intranet site. I'll check out CreateDate today, thanks for the heads up, that could save me loads of time.
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

650 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