<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Globalization" %>
<html>
<head>
<title>Culture-Specific Full DateTime Patterns</title>
<link rel="stylesheet" href="/aspxtreme/shared/netdemos.css">
<script language="C#" runat="server">
string html;
public void Page_Load ( Object src, EventArgs e ) {
DateTime now = DateTime.Now;
CultureInfo [ ] cultures = CultureInfo.GetCultures
( CultureTypes.SpecificCultures );
// write headers
html += "<table align='center' class='data' cellspacing=1>";
html += "<tr>";
html += "<th>Name</th>";
html += "<th>English Name</th>";
html += "<th>Full DateTime Pattern</th>";
html += "<th>Full DateTime Example</th>";
html += "</tr>";
// list names and full datetime formats of available cultures
foreach ( CultureInfo culture in cultures ) {
html += "<tr>";
html += "<td>" + culture + "</td>";
html += "<td>" + culture.EnglishName + "</td>";
html += "<td>" + culture.DateTimeFormat.FullDateTimePattern + "</td>";
html += "<td>" + now.ToString ( "F", culture ) + "</td>";
html += "</tr>";
}
html += "</table>";
}
</script>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h3>Culture-Specific Full DateTime Patterns</h3></div>
<hr size=1 width=90%>
<p><%= html %></p>
<hr size=1 width=90%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>