Technical support This forum is closed.
Version 1.x > Technical support > Date Format and Culture View modes: 
User avatar
Guest
norashlea - 3/21/2006 9:22:15 PM
   
Date Format and Culture
Hello,

Can someone tell me whether there is a change in Visual Studio 2005 to setting the date format?

Previously for KenticoCMS projects that I developed with VS2003, to display the date in dd/mm/yyyy format I just needed to modify <globalization> and "CMSDefaultCultureCode" in the web.config to "en-AU". But in VS2005, for either ver. 1.8b or 1.8c, this seems to be ignored for the date, and it is displaying in mm/dd/yyyy format everywhere.

Thanks,
Sharon.

User avatar
Guest
admin - 3/23/2006 2:21:56 PM
   
Re: Date Format and Culture
Hi Sharon,

could you please make sure that you have the following settings in your web.config:

<add key="CMSDefaultCultureCode" value="en-AU" />

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-AU" uiCulture="en-AU" />

This works correctly for us in VS 2005.

Best Regards,

User avatar
Guest
norashlea - 3/23/2006 2:26:38 PM
   
Re: Date Format and Culture
Hi Petr,

These are the settings I have (cutting/pasting directly from web.config):

<add key="CMSDefaultCultureCode" value="en-AU" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-AU" uiCulture="en-AU" />

Regards,
Sharon.

User avatar
Guest
admin - 3/23/2006 2:36:11 PM
   
Re: Date Format and Culture
Hi Sharon,

if I use your settings and go to Kentico CMS Deks -> My Desk -> My Recent Documents, I can see this date-time format:

23/02/2006 8:36:18 PM

Is it correct?

(I have tested this in VS 2005)

Best Regards,

User avatar
Guest
norashlea - 3/23/2006 2:40:34 PM
   
Re: Date Format and Culture
Hi Petr,

What you have in your post is the correct display, yes, but when I go to -> My Desk -> My Recent Documents in my project with the web.config settings in myprevious post, it is displayed as:

3/23/2006 4:31:08 PM

Regards,
Sharon

User avatar
Guest
admin - 3/26/2006 6:10:58 PM
   
Re: Date Format and Culture
Hi Sharon,

could you please check in your user account details in Kentico CMS Desk -> Administration -> Users if you have any Preferred Culture or Preferred UI Culture specified?

Thank you.

Best Regards,

User avatar
Guest
norashlea - 3/26/2006 9:47:40 PM
   
Re: Date Format and Culture
Hi Petr,

There's no specific Preferred Culture recorded for any of the users.

Have found, now, that this is only occurring in XP, and not in Windows Server 2003. Without making any modifications at all, the date/time is displaying correctly on Server 2003.

I can't find anywhere in IIS to specify a preferred date/time format, either on XP or Server 2003.

Regards,
Sharon.


User avatar
Guest
admin - 3/27/2006 4:21:12 PM
   
Re: Date Format and Culture
Hi Sharon,

I'm not sure why it doesn't work on your XP machine. The date-time format can be set up on your machine - Control Panels -> Regional Settings -> tab Regional Options -> Customize. Could you please check what you have there? However, I can't tell you if this really helps.

Could you please try to set the Preferred UI Culture in CMS Desk for your account to "en-AU", sign out and check if it makes any difference?

Thank you.

Best Regards,

User avatar
Guest
norashlea - 3/27/2006 7:20:43 PM
   
Re: Date Format and Culture
Still no luck!

Yes, my regional settings are correct, and I've specifically set the user's culture via CMS Desk as well.

This happens ONLY with asp.net 2.0 projects. All the 1.1 projects (CMSDesk projects, as well as other 1.1 projects) display the date/time in correct AU format. And it is only happening in IIS 5.1 on Windows XP, not in IIS6 on Windows Server 2003.

Regards,
Sharon.

User avatar
Guest
admin - 3/28/2006 12:06:01 PM
   
Re: Date Format and Culture
Hi Sharon,

could you please try to create a new web project in VS 2005 (without Kentico CMS), put the following settings to your web.config:

<globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="en-AU" uiCulture="en-AU" />

and create a simple page where you use something like this:

Label1.Text = DateTime.Now.ToString();

Does it display the date/time in correct format?

Thank you.

Best Regards,

User avatar
Guest
norashlea - 3/29/2006 12:37:31 AM
   
Re: Date Format and Culture
In a new, fresh VS2005 C# web project that contains only default.aspx, and the standard web.config created by VS2005, date is displaying in correct AU format (ie, dd-mm-yyyy) either with or without <globalization> added to the web.config.

Regards,
Sharon.

User avatar
Guest
norashlea - 3/29/2006 2:03:22 AM
   
Re: Date Format and Culture
I just started a new, fresh CMSDesk 1.8c asp.net 2.0 c# project, using the web installer and selecting blank project. The only modifications I made to the default install were:

-- modified culture in web.config to en-AU (both within the <app settings> and <globalization>)
-- added a label to default.aspx, with "Label1.text = System.DateTime.Now.ToString();

Default page displays with the date in the format mm/dd/yyyy!!!!

Regards,
Sharon.

User avatar
Guest
admin - 3/29/2006 8:46:31 PM
   
Re: Date Format and Culture
Hi Sharon,

Thank you for your message. I can confirm we can reproduce it in 1.8c / c# / 2005 / blank project version.

We will try to fix it in 1.8d update.

I'm very sorry for this inconvenience.

Best Regards,

User avatar
Guest
norashlea - 3/29/2006 8:48:54 PM
   
Re: Date Format and Culture
Thanks Petr, no need to apologize.

It's fine when the site is running on the server, and so that is the main thing.

Regards,
Sharon.