User can specify the regional settings from his My settings section. If he didnt specify system will take the current web regional settings.
Object Model:
SPRegionalSettings regionalSettings;
SPUser user = SPContext.Current.Web.CurrentUser;
regionalSettings = user.RegionalSettings;
if (regionalSettings != null)
{
lblTimeZone.Text = regionalSettings.TimeZone.Description;
}else{
regionalSettings=SPContext.Current.Web.RegionalSettings;
lblTimeZone.Text = regionalSettings.TimeZone.Description;
}
Object Model:
SPRegionalSettings regionalSettings;
SPUser user = SPContext.Current.Web.CurrentUser;
regionalSettings = user.RegionalSettings;
if (regionalSettings != null)
{
lblTimeZone.Text = regionalSettings.TimeZone.Description;
}else{
regionalSettings=SPContext.Current.Web.RegionalSettings;
lblTimeZone.Text = regionalSettings.TimeZone.Description;
}
No comments:
Post a Comment