Solved

UK Dates

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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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