GetLocale()

Gets the current geographic/language locale value.

To set the default display format of date, time, number, and currency values in a CFML application session, you use the SetLocale() function.

GetLocale( );

Returns: String

This function does not take any arguments.

Examples

var n = 1234.56;
	writeOutput( getlocale() );
	dump( dateTimeFormat( now() ) );
	dump( LSdateTimeFormat( now() ) );
	dump( numberFormat( n ) );
	dump( LSnumberFormat( n ));
<span class="nf">writeOutput</span><span class="p">(</span><span class="s1">&#39; To &#39;</span><span class="p">);</span>
<span class="nf">setLocale</span><span class="p">(</span> <span class="s1">&#39;french(switzerland)&#39;</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span> <span class="nf">getlocale</span><span class="p">()</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">dateTimeFormat</span><span class="p">(</span> <span class="nf">now</span><span class="p">()</span> <span class="p">)</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">LSdateTimeFormat</span><span class="p">(</span> <span class="nf">now</span><span class="p">()</span> <span class="p">)</span> <span class="p">);</span>
	<span class="nf">dump</span><span class="p">(</span> <span class="nf">numberFormat</span><span class="p">(</span> <span class="nv">n</span> <span class="p">)</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">LSnumberFormat</span><span class="p">(</span> <span class="nv">n</span> <span class="p">)</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span><span class="s1">&#39; To &#39;</span><span class="p">);</span>
<span class="nf">setLocale</span><span class="p">(</span> <span class="s1">&#39;German&#39;</span> <span class="p">);</span>
<span class="nf">writeOutput</span><span class="p">(</span> <span class="nf">getlocale</span><span class="p">()</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">dateTimeFormat</span><span class="p">(</span> <span class="nf">now</span><span class="p">()</span> <span class="p">)</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">LSdateTimeFormat</span><span class="p">(</span> <span class="nf">now</span><span class="p">()</span> <span class="p">)</span> <span class="p">);</span>
	<span class="nf">dump</span><span class="p">(</span> <span class="nf">numberFormat</span><span class="p">(</span> <span class="nv">n</span> <span class="p">)</span> <span class="p">);</span>
<span class="nf">dump</span><span class="p">(</span> <span class="nf">LSnumberFormat</span><span class="p">(</span> <span class="nv">n</span> <span class="p">)</span> <span class="p">);</span>

See also