Change date format mm:dd:yyyy to dd:mm:yyyy [Resolved]

Posted by Jitenkumar under ASP.NET on 5/14/2013 | Points: 10 | Views : 2839 | Status : [Member] | Replies : 3
When calendar is selected and button is click dd:mm:yyyy format will appear in textbox.




Responses

Posted by: Satyapriyanayak on: 5/14/2013 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Try
protected void Button1_Click(object sender, EventArgs e)
{
DateTime dt = Calendar1.SelectedDate;
string str = dt.ToString("dd:MM:yyyy");
TextBox1.Text = str;
}

If this post helps you mark it as answer
Thanks

Jitenkumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ankitsrist on: 5/14/2013 [Member] Starter | Points: 25

Up
0
Down
hello in ajax calendar extender there is a property format so you can change according to your need

Jitenkumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: aswinialuri-19361 on: 5/15/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

In button click event you have to mention DateTime .tostring="dd:mm:yyyy";
or else you have to change the calendar date settings means
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
string date = "";
date = Calendar1.SelectedDate.ToString("dd/MM/yyyy");

date is of the format "dd/mm/yyyy"

}
I hope it will help you
Mark As Answer if it will helps you
Thanks&Regards

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Jitenkumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response