Title: Message
LSDateFormat is also much fussier than DateFormat. You need to specify dd/mmm/yyyy. It won't like the hyphens.
 
Good luck. (Anything to do with dates always makes me cringe)
 
A big problem I've seen is that when we use dates, if the date is not ambiguous (ie. the 13th of January, there being no 13th month) then any dates like 13/01/2004 are handled perfectly, but for the first 12 days of the month, it always switches it to US format, and so treats the 12/01/2004 as the 1st of December.
This gets very frustrating, as if the date is being generated from today's date, then you only have problems for the first 12 days of any month, and then everything seems to be OK.
 
Regards
 
Darren Tracey
-----Original Message-----
From: George Lu [mailto:[EMAIL PROTECTED]
Sent: Monday, 31 May 2004 11:52 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: SQL Server date format (please help!)

Thanks Phil. But the form date input format is "dd/mm/yyyy" (and I've tried "dd-mmm-yyyy" won't work).
 
George

>>> [EMAIL PROTECTED] 31/05/04 11:38:03 >>>
In your cfscript,
 
where you have
<cfset newSQLDate = DateFormat(variable.SQLDate, "dd/mm/yyyy")>
 
instead try
<cfset newSQLDate = DateFormat(variable.SQLDate, "dd-mmm-yyyy")>
 
That way SQL will cope, regardless of whether it expects US or Aus dates.
 
Phil.
 
----- Original Message -----
From: George Lu
Sent: Monday, May 31, 2004 11:23 AM
Subject: [cfaussie] RE: SQL Server date format (please help!)

Steve,
 
Thanks for your help. I've tried it but it still come with same result (i.e. 7/6/2004 becomes 6/7/2004).
 
George

>>> [EMAIL PROTECTED] 31/05/04 11:14:00 >>>
george,
 
whenever i am inserting dates passed from a form i do this in the insert:
 
#CreateODBCDate(lsparsedatetime(form.news_finish_date))#
 
of course for this to work i have also set my locale in the application.cfm:
 
<cfsilent><cfoutput>#Setlocale("English (Australian)")#</cfoutput></cfsilent>
 
try that and see how you go, but i have never had an issue since adding the lsparsedatetime function.
 
steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Lu
Sent: Monday, 31 May 2004 11:05 AM
To: CFAussie Mailing List
Subject: [cfaussie] SQL Server date format (please help!)

Hi,
 
I've been driving crazy with this date issue. We've upgraded our Access dbs to SQL Server recently. We have form input using Aussie date format: dd/mm/yyyy and is same in the database (I've set the default language to 0 - international in SQL Server). However when I use LSDateFormat to display the date it always change to American format: mm/dd/yyyy (e.g. 7/6/2004 becomes 6/7/2004). I've tried some options:
 
<cfset SQLDate = DateFormat(Form.CloseDate, "yyyy/mm/dd")>
 
OR
 
<cfscript>
 theDate = Attributes.formfield;
 firstSeparator = find("/",theDate,0);
 theDay = left(theDate,firstSeparator-1);
 theYear = right(theDate,4);
 remaining = Right(thedate,len(thedate)-firstseparator);
 theMonth = left(remaining,find("/",remaining)-1);
 Caller.SQLDate = createdate(theYear,theMonth,theDay);
</cfscript>
<cfset newSQLDate = DateFormat(variable.SQLDate, "dd/mm/yyyy")>
 
However, none of them work! Please help!
 
Thanks in advanced.
George
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

AMES (Adult Multicultural Education Services)
www.ames.net.au


Disclaimer
**********************************************************************
This email and any attachments may be confidential.
If received in error, please contact us and delete all copies.
Before opening or using attachments you should check them for viruses
or defects.
Regardless of any loss, damage or consequence, whether caused by the
negligence of the sender or not, resulting directly or indirectly from
the use of any attached files our liability is limited to resupplying
any affected attachments.
Any representations or opinions expressed are those of the individual
sender, and not necessarily those of Adult Multicultural Education
Services (AMES).

**********************************************************************
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004
---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to