
Localization and character handling
15
LSDateFormat
In ColdFusion MX,
LSDateFormat
returns the appropriate date for the set
locale. For example,
LSDateFormat(12/01/02)
returns Jan-12-2002 if the
locale is set to English (UK), and Dec-01-2002 if the set locale is
English(US).
In ColdFusion 5,
LSDateFormat
throws an error or returns an incorrect
format.
When no mask is specified, ColdFusion MX returns the Java medium date
format for the locale. ColdFusion 5 returns one of two default masks,
depending on the locale:
•
For a locale where the date ends with the year, the default mask is
dd-mmm-yy
.
•
For a locale where the date begins with the year, the default mask is
yyyy-mmm-dd
.
The
medium
date format for English (US) has changed to the Java
standard; for example, “Sept 4, 1998 11:15:16 PM" and "11:15:16 PM Sept.
4, 1998" are valid. However, "23:15:16 4 Sept. 1998" is not valid; for
example,
LSParseDateTime("23:15:16 4 Sept. 2003")
causes an error.
For a list of valid date formats, see the Java documentation for the
java.text.DateFormat class at
http://java.sun.com/j2se/1.3/docs/api/
index.html
.
If you pass an invalid mask (for example,
"dd-mm-yymm")
,
LSDateFormat
outputs the invalid characters in both ColdFusion 5 and ColdFusion MX.
However, ColdFusion 5 delimits each character of the output with an
apostrophe (') character.
LSTimeFormat
ColdFusion MX supports the following masks for
LSTimeFormat
:
•
h:m:s
LSTimeFormat("6:39","h:m:s")
returns 6:39:0
•
hh:mm:ss
LSTimeFormat("6:39","hh:mm:ss")
returns 06:39:00
•
hh:mm:ss t
LSTimeFormat("6:28:26","hh:mm:ss t")
returns
06:28:26 A
•
hh:mm:ss tt
LSTimeFormat("6:28:26","hh:mm:ss tt")
returns
06:28:26 AM
If you pass an invalid mask,
LSTimeFormat
outputs the invalid characters in
both ColdFusion 5 and ColdFusion MX. However, ColdFusion 5 delimits
each character of the output with an apostrophe (') character.
LSIsCurrency
When a euro currency is passed into the
LSIsCurrency
function,
ColdFusion MX returns Yes if the locale is a Euro member, and No if not,
independent of the JVM version. With 1.3 level JVMs only, this function
also returns Yes if the currency is in a Euro zone country’s pre-Euro
currency format.
LSIsDate
In ColdFusion MX, you can pass in dates with the
full date
and
full
datetime
parameters. These formats include the name of the day (for
example, Wednesday).
Function
Description of change