By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 997 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

.net Calendar

P: n/a
Hi everyone,

..NET Calendar control treats all dates in the format of MM/DD/YYYY. Is it
possible to change the calendar property to treat date at DD/MM/YYYY?

Thank you
Maz.
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
If you mean for display purposes,
set the @Page culture directive :

I have the culture for the page
where my calendar lives set to :

<%@ Page Culture="es-DO" %>

It displays in spanish, in my local date format,
even though I'm running an english-language
version of W2K3 Server.

I think that if you set the culture to "en-GB",
you'll get the dates treated as DD/MM/YYYY .

Check for side-effects, though.
( like time formatting or language quirk differences
between GB English and US English )

Please let us know how you do.

Juan T. Llibre
ASP.NET MVP
===========
"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:HN********************@rogers.com...
Hi everyone,

.NET Calendar control treats all dates in the format of MM/DD/YYYY. Is it
possible to change the calendar property to treat date at DD/MM/YYYY?

Thank you
Maz.

Nov 19 '05 #2

P: n/a
Hi Maziar,

You can set the culture for the page to a culture that uses that format
(like Canadian English):

<%@ Page culture="en-CA" Language="vb" AutoEventWireup="false"
Codebehind="calpgculture.aspx.vb" Inherits="p4320work.calpgculture"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>calpgculture</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="FlowLayout">
<form id="Form1" method="post" runat="server">
<asp:calendar id="Calendar1" runat="server"></asp:calendar>
<p>
<asp:label id="Label1" runat="server">Label</asp:label></p>
<p>&nbsp;</p>
</form>
</body>
</html>

Private Sub Calendar1_SelectionChanged _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
Label1.Text = Calendar1.SelectedDate.ToShortDateString
End Sub

Ken
Microsoft MVP [ASP.NET]
Toronto

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:HN********************@rogers.com...
Hi everyone,

.NET Calendar control treats all dates in the format of MM/DD/YYYY. Is it
possible to change the calendar property to treat date at DD/MM/YYYY?

Thank you
Maz.


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.