.NET Calendar MM/DD to DD/MM

Discussion in 'ASP .Net Web Controls' started by Maziar Aflatoun, Jan 18, 2005.

  1. 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.
     
    Maziar Aflatoun, Jan 18, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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.
    >
     
    Ken Cox [Microsoft MVP], Jan 19, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shelly

    Calendar control in .NET

    Shelly, Feb 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    449
    Max-Ph. Blickenstorfer
    Feb 5, 2004
  2. Amit Bahree

    Re: about calendar in ASP.NET

    Amit Bahree, Mar 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    373
    Amit Bahree
    Mar 9, 2005
  3. Shevek
    Replies:
    3
    Views:
    6,050
    Shevek
    Jun 23, 2004
  4. Shevek
    Replies:
    0
    Views:
    393
    Shevek
    Jun 23, 2004
  5. Parthiv Joshi
    Replies:
    1
    Views:
    708
    Samuel L Matzen
    Jul 6, 2004
Loading...

Share This Page