Formatting time using the current user's format settings in Dynamics CRM

326 Views Asked by At

I've a control in an SSRS report which shows date time values and am trying to format it using the current user's format settings for time (User could set it to HH:mm or hh:mm tt).

I'm using Dynamics CRM built-in parameter CRM_ShortTimePattern to do that. But that does not seem to work. Any idea on how to achieve this?

1

There are 1 best solutions below

0
On BEST ANSWER

Getting the value from the UserSettings table via a filtered view is much more reliable than the built-in CRM parameters like CRM_ShortTimePattern or CRM_FormatTime. I used the following query to get the current user's time format:

select [TimeFormatString] from [FilteredUserSettings] where [SystemUserId] = dbo.fn_FindUserGuid()