Solved

UK Dates

Posted on 2003-11-11
7
316 Views
Last Modified: 2013-12-24
Hi

I'm using a MySQL database and I'm trying to insert a date into it using a web form in the format DD/MM/YY (UK style)  01/11/03 - 1st Novmeber 03.

When I insert a date using a form I use the following code:

<cfqueryparam value="#FORM.APPLY_BY#" cfsqltype="cf_sql_timestamp">

But when I display the value on a web page, I find that the database has inserted my date as MM/DD/YY (US Style)  01/11/03 - 11th January 03.

How can I change the insert code, so that it can be inserted DD/MM/YY?

Thanks in advance
0
Comment
Question by:nelliott
[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
7 Comments
 
LVL 10

Expert Comment

by:Mause
ID: 9723182
try LSDateFormat()

Mause
0
 

Author Comment

by:nelliott
ID: 9723257
I already am.  I'm displaying it as so:

#LSDateFormat(jobs.APPLY_BY,'DDDD, MMMM DD YYYY')#

It's the entering the data I need to get sorted, not the displaying I think....
0
 
LVL 5

Accepted Solution

by:
dc197 earned 250 total points
ID: 9724077
I always do one of the following:

1.  Use an ODBC date format:  {ts '2003-11-01 10:20:30'}
    <cfset UkDate = CreateODBCDate("#Now()#")>
    <cfset UkDate = CreateODBCDateTime("#Now()#")>


2.  Format using long month names, removes ambiguity:
       <cfset UkDate = DateFormat("#Now()#"  ,    "dd mmm yyyy")  >
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9728441
let the date will be inserted in the default database format !

change the display when u r displaying it on the browser - using dateformat()

OR chnage the default date settings for ur DB !

HTH

K'Rgds
Anand
0
 
LVL 5

Expert Comment

by:dc197
ID: 10999558
OK by me :-)
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
What You Need to Know when Searching for a Webhost Provider
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

630 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