1

I want to fetch the regional settings of currently logged in user NOT the current web.

Reason being, the regional settings and language settings is pushed through user profile service (or user might modify as well). So the regional settings of the web is different than the the regional settings set from the user profile.

During my investigations, SharePoint injects _spRegionalSettings object on the page when we add e.g., NewsFeed webpart or when we have list view. There is SP.DateTimeUtil.js file that SharePoint has internally to render date time based on user's settings.

I haven't found a way to achieve similar results so far.

Any help will be appreciated.

bumped to the homepage by Community 2 days ago

This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

0

Detecting the Current User’s Regional Settings with jQuery

--- By Marc D Anderson

var url = _spPageContextInfo.webAbsoluteUrl+"/_layouts/regionalsetng.aspx?Type=User";
var lcid, cultureInfo, timeZone;

$.get(url,function(data){
  $(data).find("select[name$='LCID'] option:selected").each(function(){
      lcid  = $(this).attr("value");
      cultureInfo  = $(this).text();
  });
  $(data).find("select[name$='TimeZone'] option:selected").each(function(){
    timeZone  = $(this).text();
  });

  alert(lcid + "::" + cultureInfo + "::" + timeZone);
});
  • Thanks Atish, I have tried this and this approach is good but it's based on UI and I don't want to go for this approach. Would prefer some other way, if there is one. Besides, this doesn't take into consideration Day time savings. – Sanjay Bhagia Jun 27 '16 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.