one thing to keep in mind is that dateformat has an always predictable
result (regardless of the locale),
where as LsDateFormat is not predictable due to it's dependancy on the
locale....

Therefore it makes sense to have two functions and CF is always backwards
compatible, hence no deprectation

z

On Jan 7, 2008 3:01 PM, AJ Mercer <[EMAIL PROTECTED]> wrote:

> you can override the OS settings with
>     SetLocale(new_locale)
>
>
> eg, for Australia
> SetLocale("English (Australian)")
>
>
>
> On Jan 7, 2008 12:32 PM, MrBuzzy < [EMAIL PROTECTED]> wrote:
>
> > Hi y'all, I'm not completely sure that this is a problem that needs to
> > get fixed... maybe I'm missing something...? Barry I'm definitely feeling
> > your pain on this one ;)
> >
> > Dateformat will format dates in US format regardless of the
> > set/selected/configured/OS/JVM locale.
> >
> > LSDateFormat will format (and parse) using the specified locale.
> >
> > Both will allow you to mask the output format in the same way, ie "dd mm
> > yyyy" or  "mm dd yyyy"
> >
> > IMO the difference (and cause of confusion in non US places) is two
> > fold;
> >   1. Often a non-US application could be hosted in the US or the server
> > has the locale set to US when it shouldn't be. Some won't be aware of it -
> > hence the "LS" parsing will be US anyhow.
> >   2. DateFormat will parse strings to dates (as will DateParse). BUT
> > when doing so it's too smart (or dumb) ... Dateformat will accept an input
> > string like "29 01 2007" clearly this is not a US but DateFormat will parse
> > correctly it because there is no ambiguity - IMO this scenarios should throw
> > an error instead, it would help avoid problems.
> >
> > I don't think it can be deprecated. How would you then parse a US date
> > string to a date object without setting your local to US?
> > Perhaps another parse/format function that can be used by explicitly
> > specifying the input at output masks. ie; DateStringFormat(strDate,"mm dd
> > yy","dd mm yy").
> >
> > Barry, am I right to assume your problem was with dates as strings?
> >
> > Cheers.
> >
> > btw... I really am in a different world today - kicking back in Adelaide
> > with a beach view niiiiice ;)
> >
> >
> > On Jan 7, 2008 11:42 AM, Haikal Saadh <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > Retrofitting DataFormat to do what LSDateFormat does breaks
> > > principle-of-least-surprise; Probably won't be too long before an
> > > angry
> > > mob gathers.
> > >
> > > That said, deprecating DateFormat sounds like a good idea, if for no
> > > other reason but the fact that it makes your app easier to localise.
> > >
> > > Andrew Scott wrote:
> > > > Very good question,
> > > >
> > > > LS, or location / region settings was an added hack to get
> > > localisation
> > > > working. My view is that it is about time that this was all brought
> > > internal
> > > > to Coldfusion, so that we as developers make one setting either in
> > > the OS,
> > > > or Admin of CF and forget about it.
> > > >
> > > > However it is there for backwards compatability. But if it wasn't a
> > > hack in
> > > > the first place, I do not think we would fall into this trap...
> > > >
> > > > And yes I still fall into this trap, even though I should know
> > > better.
> > > >
> > > > As for LSDateFormat working in the USA, it does as long as
> > > setLocale() is
> > > > set to that region.
> > > >
> > > >
> > > >
> > > > Andrew Scott
> > > > Senior Coldfusion Developer
> > > > Aegeon Pty. Ltd.
> > > > www.aegeon.com.au
> > > > Phone: +613  9015 8628
> > > > Mobile: 0404 998 273
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED]
> > > On Behalf
> > > > Of Barry Beattie
> > > > Sent: Monday, 7 January 2008 11:24 AM
> > > > To: cfaussie@googlegroups.com
> > > > Subject: [cfaussie] should DateFormat() be depricated (in favour of
> > > > LSDateFormat())?
> > > >
> > > >
> > > > I've been fighting an application (since 7:00am this morning) and it
> > >
> > > > turns out that is has a generous use of DateFormat() within it.
> > > >
> > > > I'm quietly confident that replacing them with LSDateFormat() will
> > > > start it making sense again.
> > > >
> > > > but the trouble there is how to add it into the app - pick up the
> > > > locale in the setup ini file and if en_US then use dateFormat else
> > > use
> > > > LSDateFormat?
> > > >
> > > > or just use LSDateFormat (relying on CF to get it right everywhere)
> > > > and in the ini setup file, set the date display mask?
> > > >
> > > > and if the latter, is there a usecase for DateFormat() at all?
> > > >
> > > > I suppose I should ask this on a U.S list... I'm sure they're aware
> > > if
> > > > LSDateFormat doesn't work for them just as we're acutely aware that
> > > > DateFormat doesn't play nicely in out region.
> > > >
> > > > thoughts? comments? experiences?
> > > >
> > > > thanx
> > > > barry.b
> > > >
> > > >
> > > >
> > > > >
> > > >
> > > >
> > >
> > >
> > >
>
>
> --
>
> AJ Mercer
> Web Log: http://webonix.net
>
> >
>


-- 
Zac Spitzer -
http://zacster.blogspot.com (My Blog)
+61 405 847 168

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to