Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to Change the Time Ruler's Time Format

The default time format depends on regional settings. If you wish to enable 12-hour format regardless of system settings, override the TcxSchedulerDateTimeHelper‘s GetIs24HourTimeFormat method, as shown in the following example:

// ...
uses
  cxSchedulerUtils;
// ...
type
  TcxSchedulerCustomDateTimeHelper = class(TcxSchedulerDateTimeHelper)
  protected
    class function GetIs24HourTimeFormat: Boolean; override;
  end;
implementation
// ...
class function TcxSchedulerCustomDateTimeHelper.GetIs24HourTimeFormat: Boolean;
begin
  // specify that the 12-hour format is to be used
  Result := False;
end;
initialization
  // specify a custom date-time utility for the scheduler
  DateTimeHelper := TcxSchedulerCustomDateTimeHelper;
  // update the format
  DateTimeHelper.Refresh;
end.

The following image shows the result of the code execution:

See Also