Hiya, Long ago i decided not to trust any date format that CF provides and instead parse all user-entered dates as a string to turn into a CF date object, e.g.
<CFSET thedate = CreateDate(ListGetAt(Form.inputdate,3,'/'), ListGetAt(Form.inputdate,2,'/'), ListGetAt(Form.inputdate,1,'/'))> The use CreateODBCDateTime to get it into the database. Is this an option with your application? It's only a couple of extra lines of code.. and you can be sure that whatever server you move your app to it will always work the same way. bye Monday, May 31, 2004, 12:32:45 PM, you wrote: DT> LSDateFormat is also much fussier than DateFormat. You need to specify dd/mmm/yyyy. It won't like the hyphens. DT> Good luck. (Anything to do with dates always makes me cringe) DT> 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 DT> 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. DT> 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. DT> Regards DT> Darren Tracey DT> -----Original Message----- DT> From: George Lu [mailto:[EMAIL PROTECTED] DT> Sent: Monday, 31 May 2004 11:52 AM DT> To: CFAussie Mailing List DT> Subject: [cfaussie] RE: SQL Server date format (please help!) DT> Thanks Phil. But the form date input format is "dd/mm/yyyy" (and I've tried "dd-mmm-yyyy" won't work). DT> George >>>> [EMAIL PROTECTED] 31/05/04 11:38:03 >>> DT> In your cfscript, DT> where you have DT> <cfset newSQLDate = DateFormat(variable.SQLDate, "dd/mm/yyyy")> DT> instead try DT> <cfset newSQLDate = DateFormat(variable.SQLDate, "dd-mmm-yyyy")> DT> That way SQL will cope, regardless of whether it expects US or Aus dates. DT> Phil. DT> ----- Original Message ----- DT> From: George Lu <mailto:[EMAIL PROTECTED]> DT> To: CFAussie Mailing List <mailto:[EMAIL PROTECTED]> DT> Sent: Monday, May 31, 2004 11:23 AM DT> Subject: [cfaussie] RE: SQL Server date format (please help!) DT> Steve, DT> Thanks for your help. I've tried it but it still come with same result (i.e. 7/6/2004 becomes 6/7/2004). DT> George >>>> [EMAIL PROTECTED] 31/05/04 11:14:00 >>> DT> george, DT> whenever i am inserting dates passed from a form i do this in the insert: DT> #CreateODBCDate(lsparsedatetime(form.news_finish_date))# DT> of course for this to work i have also set my locale in the application.cfm: DT> <cfsilent><cfoutput>#Setlocale("English (Australian)")#</cfoutput></cfsilent> DT> try that and see how you go, but i have never had an issue since adding the lsparsedatetime function. DT> steve DT> -----Original Message----- DT> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of George Lu DT> Sent: Monday, 31 May 2004 11:05 AM DT> To: CFAussie Mailing List DT> Subject: [cfaussie] SQL Server date format (please help!) DT> Hi, DT> 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 DT> 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). DT> I've tried some options: DT> <cfset SQLDate = DateFormat(Form.CloseDate, "yyyy/mm/dd")> DT> OR DT> <cfscript> DT> theDate = Attributes.formfield; DT> firstSeparator = find("/",theDate,0); DT> theDay = left(theDate,firstSeparator-1); DT> theYear = right(theDate,4); DT> remaining = Right(thedate,len(thedate)-firstseparator); DT> theMonth = left(remaining,find("/",remaining)-1); DT> Caller.SQLDate = createdate(theYear,theMonth,theDay); DT> </cfscript> DT> <cfset newSQLDate = DateFormat(variable.SQLDate, "dd/mm/yyyy")> DT> However, none of them work! Please help! DT> Thanks in advanced. DT> George DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> AMES (Adult Multicultural Education Services) DT> www.ames.net.au DT> Disclaimer DT> ********************************************************************** DT> This email and any attachments may be confidential. DT> If received in error, please contact us and delete all copies. DT> Before opening or using attachments you should check them for viruses DT> or defects. DT> Regardless of any loss, damage or consequence, whether caused by the DT> negligence of the sender or not, resulting directly or indirectly from DT> the use of any attached files our liability is limited to resupplying DT> any affected attachments. DT> Any representations or opinions expressed are those of the individual DT> sender, and not necessarily those of Adult Multicultural Education DT> Services (AMES). DT> ********************************************************************** DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> AMES (Adult Multicultural Education Services) DT> www.ames.net.au DT> Disclaimer DT> ********************************************************************** DT> This email and any attachments may be confidential. DT> If received in error, please contact us and delete all copies. DT> Before opening or using attachments you should check them for viruses DT> or defects. DT> Regardless of any loss, damage or consequence, whether caused by the DT> negligence of the sender or not, resulting directly or indirectly from DT> the use of any attached files our liability is limited to resupplying DT> any affected attachments. DT> Any representations or opinions expressed are those of the individual DT> sender, and not necessarily those of Adult Multicultural Education DT> Services (AMES). DT> ********************************************************************** DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> AMES (Adult Multicultural Education Services) DT> www.ames.net.au DT> Disclaimer DT> ********************************************************************** DT> This email and any attachments may be confidential. DT> If received in error, please contact us and delete all copies. DT> Before opening or using attachments you should check them for viruses DT> or defects. DT> Regardless of any loss, damage or consequence, whether caused by the DT> negligence of the sender or not, resulting directly or indirectly from DT> the use of any attached files our liability is limited to resupplying DT> any affected attachments. DT> Any representations or opinions expressed are those of the individual DT> sender, and not necessarily those of Adult Multicultural Education DT> Services (AMES). DT> ********************************************************************** DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 DT> --- DT> You are currently subscribed to cfaussie as: [EMAIL PROTECTED] DT> To unsubscribe send a blank email to [EMAIL PROTECTED] DT> MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia DT> http://www.mxdu.com/ + 24-25 February, 2004 ----------------------- Ryan Sabir Newgency Pty Ltd 2a Broughton St Paddington 2021 Sydney, Australia Ph (02) 9331 2133 Fax (02) 9331 5199 Mobile: 0411 512 454 http://www.newgency.com/index.cfm?referer=rysig --- 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
