This is a migrated thread and some comments may be shown as answers.

[Solved] date format issue

4 Answers 108 Views
Input
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 22 Sep 2009, 11:38 AM
in the global.asax file, ive set the current culture as below

 

protected void Application_BeginRequest(object sender, EventArgs e)

 

{

 

Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");

 

 

Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");

 

}



in my .aspx page, I have a date input like this

<

 

telerik:RadDatePicker ID="RadDatePickerNewsDate" runat="server" Calendar-CultureInfo="English (United Kingdom)" MinDate="01/01/2000 00:00:00" SkinID="Vista">

 

 

</telerik:RadDatePicker>

 



in my codebehind, I set the default date like this

this

 

.RadDatePickerNewsDate.SelectedDate = DateTime.Now;

 



and the date comes out in American format.  Why is this ?   eg 09/22/2009

4 Answers, 1 is accepted

Sort by
0
mww
Top achievements
Rank 1
answered on 22 Sep 2009, 12:19 PM
even when I select a date from the popup calendar, its still in US format, how can this be changed ?????
0
Daniel
Telerik team
answered on 23 Sep 2009, 09:27 PM
Hello Mark,

Could you please try to set the Culture directly on your RadDatePicker?
<telerik:RadDatePicker ID="RadDatePicker1" runat="server" Culture="en-GB"
    ... 
</telerik:RadDatePicker> 

Let me know whether this helps.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
mww
Top achievements
Rank 1
answered on 24 Sep 2009, 09:20 AM

whats the difference between this

Calendar-CultureInfo="English (United Kingdom)"

and this

Culture="en-GB"

0
Daniel
Telerik team
answered on 29 Sep 2009, 03:09 PM
Hello Mark,

Calendar-CultureInfo applies to the nested control only(Calendar), unlike the second approach that will affect the whole control.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Input
Asked by
mww
Top achievements
Rank 1
Answers by
mww
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or