public int? RetrieveCurrentUsersTimeZoneSettings(IOrganizationService service)
{
     var currentUserSettings = service.RetrieveMultiple(
     new QueryExpression("usersettings")
     {
        ColumnSet = new ColumnSet("localeid", "timezonecode"),
        Criteria = new FilterExpression
        {
            Conditions =
        {
            new ConditionExpression("systemuserid", ConditionOperator.EqualUserId)
        }
        }
     }).Entities[0].ToEntity<Entity>();
     return (int?)currentUserSettings.Attributes["timezonecode"];
}
*You just need to pass the current CRM Service
Hope this helps.
Thanks.

Wow! Great post! The content is very rich, and I really like it.
ReplyDeleteMicrosoft Dynamics AX Training | Microsoft Dynamics CRM Online Training
thank you so much
ReplyDelete