G'day..

Has anyone come across changing the date format for a site collection from mdy to dmy on the default locale "en-US", instead of changing the locale to en-AU.

This is the Sample Code applied and update fails only when playing with Locale info.

// Code start
DateTimeFormatInfo dtf = new DateTimeFormatInfo();
dtf.ShortDatePattern = "dd/mm/yyyy";
CultureInfo ci = CultureInfo.CreateSpecificCulture("en-US");
ci.DateTimeFormat = dtf;

SPWebApplication webapp = ws.WebApplications["<WebName>"];

// values assigned from Properties.Settings

            string url = Properties.Settings.Default.URL;
            string title = Properties.Settings.Default.Title;
            string description = Properties.Settings.Default.Description;
            uint locale = (uint) 1033;
            string ownerlogin = Properties.Settings.Default.OwnerLogin;
            string ownername = Properties.Settings.Default.OwnerName;
            string owneremail = Properties.Settings.Default.OwnerEMail;
            string webtemplate = Properties.Settings.Default.WebTemplate;

            using (SPSite site = webapp.Sites.Add(
                url,
                title,
                description,
                locale,
                webtemplate,
                ownerlogin,
                ownername,
                owneremail
                ))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    web.Locale = ci;
                    web.Update(); // fails here
                }
            }
// Code end

Also changing using the UI works..

Any thoughts..

thanks, Zak


------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net


Reply via email to