Solved

UK Dates

Posted on 2003-11-11
7
314 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

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…
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 …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
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 …

830 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