ok thanks this works great
~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
In what format are the original dates you're passing to the dateformat
function - entered via a form, coming from a database, or some other
way?
-Original Message-
From: Richard White [mailto:[EMAIL PROTECTED]
Sent: 31 October 2006 14:52
To: CF-Talk
Subject: Re: date format problem
can i ask how other people get around the dateformat, or any
suggesstions on how i can get around it, as i am finding more and more
that the dateformat function just doesnt work. it switches between
formatting my dates from dd/mm/ and mm/dd/ even though i specify
a format of
can i ask how other people get around the dateformat, or any suggesstions on
how i can get around it, as i am finding more and more that the dateformat
function just doesnt work. it switches between formatting my dates from
dd/mm/ and mm/dd/ even though i specify a format of dd/mm/
Here, we always use dd-mmm-. Prevents any ambiguity from incorrect ordering.
For user input, we accept dd/mm/yy, but format it onBlur with JavaScript to
dd-mmm- (for our Dallas-based office we use a different JS function)
Also, within CF, always keep dates as Date Objects, not Strings;
maybe you want to use the setLocale() function on the pages where you
want to show the date in dd/mm/ format.
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa80.htm
dateFormat() itself is handy for giving you various date mask options
(e.g. dd, or mm d yy or
thanks for the replies i will look into your suggesstions.
Thanks david my database is mysql and it stores and outputs in the format of
/mm/dd but my app will be basedo n the UK so i need it in the format of
dd/mm/.
I have been getting it out of the database and storing it in a
You can try this
cfset temp = SetLocale(en_GB)
cfoutput
#LSDateFormat(MyDate,dd.mm.)#
/cfoutput
I use same structure for German and Turkish pages.
Sincerely,
OÄuz Demirkapı
Richard White wrote:
thanks for the replies i will look into your
this is perfect thanks claude :)
~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
What you show the user is a formated date. What you store in the database
should be native to the database. A good suggestion would be to store the
date/time into an ODBC Date/Time format, so you can convert it easily into
any format you like. For user input, you just need to roll your own
I have had a lot of problems with CF and mysql as well, my workaround was to
use LSDateFormat when inserting into the database and displaying as well.
~|
Introducing the Fusion Authority Quarterly Update. 80 pages of
Are you using cfqueryparam's to query the database? That should fix it as far
as I know. If you can only do it with a string containing '/mm/dd' kinda
format you can have a look at the
SET DATEFORMAT
option, assuming you are using MS SQL. You'd probably need
SET DATEFORMAT ymd
in that
I had a similar problem when using mysql, the problem for me occured when I was
inserting the dates into the database form some reason mysql took it upon
itself to rearrange the dates if I inserted a date such as 25-10-2006 this
inserted fine, if I inserted a date such as 9-10-2006 the 9 and 10
thanks for your replies. I am using mysql as well and the dates are fine in
mysql. I run the command in mysql and it outputs the results. I am also using
the cfqueryparam
The problem occurs somehow in the date format, as when i convert it back to
supposedly /mm/dd i cfoutput'd the result
i just took of the format to dd/mm/ when i retrieved the date from the
database and left the format to /mm/dd when i sent it to a query for
querying the database and it now works fine.
So i suppose if i am going to display it to the user i can use the cfinput
datefield type with a
i am noticing alot of problems with the dateformat and wondering if it is just
me.
I place a date in a text box and use the dateformat dd/mm/ i also cfoutput
the dateformat in dd/mm/ and somtimes it shows as dd/mm/ in the text
box and mm/dd/ in the cfoutput
It seems very
16 matches
Mail list logo