Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

UK Dates

Posted on 2003-11-11
7
Medium Priority
?
318 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 1000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

719 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