Skip to content

Date Formatting based on Persian calendar

The default calendar used by the tool when formatting dates is the Gregorian calendar which is the most widely used around the world. However to support date formatting for languages such as Arabic and Farsi the tool utilizes the Persian calendar.

Enable Persian calendar support

In order to format dates based on Persian calendar you must first enable this feature. See steps listed below.

Select Options from the tool's Edit menu.

In the IFS Report Designer Options dialog select Enable bidirectional printing and Persian Calendar support checkbox. Press Ok to continue.

Now you have configured the tool to use the Persian calendar to be the default calendar when formatting dates for languages Arabic and Farsi. If you go back to Edit menu and select menu option Bidirectional printing you will see that the Persian calendar has been selected as the default calendar to be used when formatting dates. See below. This setting is automatically set when you select Persian calendar support in the previous step. Therefore you need not set it manually.

Clearing the above checkbox Use Persian calendar by default will revert the tool to using the Gregorian calendar again.

Format dates

To begin formatting, select the right mouse button menu option Format->Format Date of the date/time field as shown below.

You will be presented with the Format Date dialog.

Formatting of dates using Persian calendar is made available through the Use Persian Calendar checkbox. This option will be selected by default when Enable bidirectional printing and Persian Calendar support is selected from the Options dialog.

Now, select a suitable date/time mask from the list of available values.

The date/time will be formatted according to the selected mask and will be based on the locale Farsi (Iran). For example consider the Persian format mask "y/M/d HH:mm:ss". If the date "6/1/2006" is formatted based on this mask you would have the output shown as:

While having the Persian calendar support, it is also possible to format a date using the Gregorian calendar. Simply clear the Use Persian Calendar checkbox and this will enable the Gregorian formatting options available in the dialog. See below.

Read here for more information on formatting dates based on Gregorian calendar.