locked
Date Format in DD/MM/YYYY RRS feed

  • Question

  • User672081070 posted

    Hi all i have taken a calendar control near a text box so that the selected date should be placed in textbox. But it's displayin as mm/dd/yyyy. I need that to be displayed like dd/mm/yyyy can any one help me out how to do that..


    Thanks & Regards,

    M.Dorababu

    Tuesday, December 22, 2009 5:53 AM

Answers

All replies

  • User-1130287460 posted

                Dim DTE As Date
                DTE = Calendar1.SelectedDate
                TextBox1.Text = Format(DTE, "dd-MMM-yyyy")

                Dim DTE As Date

                DTE = Calendar1.SelectedDate

                TextBox1.Text = Format(DTE, "dd/MM/yyyy")

    Tuesday, December 22, 2009 7:32 AM
  • User-82570477 posted

    hi

    try this

    DateTimedt = DateTime.Now();

    dt.ToString("dd-mm-yyyy");

     

    or try this

    DateTime.Now.ToString("MM/dd/yyyy");

    DateTime.Now.ToString("MMM dd yyyy");

    DateTime.Now.ToString("dd/MM/yyyy");

    or try this link

    http://geekswithblogs.net/vivek/archive/2007/06/14/113221.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 22, 2009 7:43 AM
  • User-1455009591 posted

    Hi,

    you can use DateTime.ToString(string) overloaded method:

    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
            {
                TextBox1.Text = Calendar1.SelectedDate.ToString("dd/MM/yyyy ");
            }


     good examples DateTime.ToString() patterns are here:

    http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm

    Tuesday, December 22, 2009 7:44 AM