Formatting Locale-Specific Data in ASP


Setting the Session.LCID property allows setting of formatted items such as dates ti differing formats depending on a country in which a browser is situated.


<%
Dim nI, arrLCID
arrLCID=Array(3081,4105,2057,1033,1036,1031,1041,1049)
arrLCIDNation=Array("English (Australian)","English (Canadian)","English (United Kingdom)","English (United States)","French (Standard)","German (Standard)", "Japanese","Russian","Spanish (Modern)");
%>

<HTML>
<BODY>

<TABLE>

<TR>
	<TH>LCID</TH>
	<TH WIDTH="50"></TH>
	<TH>Date and Time</TH>
	<TH WIDTH="50"></TH>
	<TH>Locale</TH>
</TR>

<%
For nI = 0 to UBound(arrLCID)
	Session.LCID = arrLCID(nI)
%>

<TR>
	<TD><%= arrLCID(nI) %></TD>
	<TD></TD>
	<TD><%= Now %></TD>
	<TD></TD>
	<TD><%= arrLCIDNation(nI) %></TD>
</TR>

<% Next %>

</TABLE>