While running ColdFusion, it basically uses the system locale which is available on the server's JVM level. While formatting locale related data, we may require to switch current locale.
The locale should be updated as requested/required locale.
We can change the locale which is used to format locale specific
tags/functions with SetLocale function as following.
<cfscript>
/*
Setting required locale
tr_TR used for Turkish
*/
SetLocale("tr_TR");
</cfscript>
It will allow us to use formatting in defined locale as
following.
<cfscript>
/*
Setting required locale
tr_TR used for Turkish
*/
SetLocale("tr_TR");
/* Defining custom parameters
*/
myTime = Now();
myDateFormat = "DD MMMM YYYY,
DDDD";
</cfscript>
<cfoutput>
#LSDateFormat(myTime,myDateFormat)#
</cfoutput>
All available locales which are supported in ColdFusion can
be accessible on the "server.coldfusion.supportedlocales" list
dump.
+