Text object macros

From DISE KnowledgeBase

Jump to: navigation, search

In the Text, Ticker and Table objects you have the option to enable Parse macros. This option will replace any macro in the text with the current date and time or other local data.

You can edit these macros directly in the objects, just click on the Insert macro button and select the macros you want, including time zone and language settings.


If you would like to show a time in the text object local time you can select the Time macro from the Time Macros sub menu. This show in the text object as:

%X

and in the preview as

16:25:36

Formatting is done using your system settings as default, but we can force a specific language to for example get AM/PM time. This is using the English language (Language Macros > A-I > English)

%L=1033%X

and in the preview as

4:25:36 PM

If I then would like to add another time zone, for example GMT +1 (Stockholm...) place the cursor before the %X text and right click, from the menu select: Time Zone Macros > GMT + > GMT +1 Amsterdam This will show in the text object as:

%Z=110%X

and in the preview as

17:25:36


It is also possible to add several time zone (and language) macros to the same text, for example this text:

%Z=110%X
%Z=20%X

Will show in the preview as this:

17:25:36
10:27:30


Using language macros the following macros will show the full month name in French:

%L=1036%B

Show in the preview as

octobre


It is also possible to force the first character of a text macro into being a capital character using the ! modifier:

%!B

Show in the preview as

October

Date macros

Macro Result
%a Abbreviated weekday name
%A Full weekday name
%b Abbreviated month name
%B Full month name
%c Date and time
%#c Long date and time representation, appropriate for current locale. For example: Tuesday, March 14, 1995, 12:41:29
%C Century as a decimal number (00 - 99). For example, 1992 => 19
%d Two-digit day of month (01 - 31)
%#d Two-digit day of month, remove leading zeros (if any)
%D Date
%e Day of the month as a decimal number in a two-digit field with leading space (1 -31)
%h Abbreviated month name (Same as %b)
%j Three-digit day of year (001 - 366)
%#j Three-digit day of year, remove leading zeros (if any)
%m Two-digit month as a decimal number (1 - 12)
%#m Two-digit month as a decimal number, remove leading zeros (if any)
%u Weekday as a decimal number (1 Monday - 7 Sunday)
%U Two-digit week number where Sunday is the first day of the week (00 - 53)
%#U Two-digit week number where Sunday is the first day of the week, remove leading zeros (if any)
%w Weekday where 0 is Sunday (0 - 6)
%#w Weekday where 0 is Sunday, remove leading zeros (if any)
%W Two-digit week number where Monday is the first day of week the week (00 - 53)
%#W Two-digit week number where Monday is the first day of week the week, remove leading zeros (if any)
%x Date
%#x Long date representation, appropriate to current locale. For example: Tuesday, March 14, 1995
%y Two-digit year without century (00 to 99)
%#y Two-digit year without century, remove leading zeros (if any)
%Y Year with century
%#Y Year with century, remove leading zeros (if any)

Time macros

Macro Result
%H Hour of the day, 24 hour day
%#H Hour of the day, 24 hour day, remove leading zeros (if any)
%I Two-digit hour, 12 hour day (01 - 12)
%#I Two-digit hour, 12 hour day, remove leading zeros (if any)
%M 2-digit minute (00 - 59)
%#M 2-digit minute, remove leading zeros (if any)
%p AM or PM
%r 12-hour time (01 - 12) format with am/pm string i.e. '%I:%M:%S %p'
%S Two-digit second (00 - 59)
%#S Two-digit second, remove leading zeros (if any)
%T 24-hour time (00 - 23) in the format 'HH:MM:SS'
%X Time
%z Time zone name, or no characters if no time zone
%Z Set time zone, for example %Z=85 will set the time zone for macros following to GMT.

Other macros

Macro Result
%% Character %
%n Row break / new line.
%L Set language, for example: %L=1036 will show macros following in French locale.
%t Tab character
! Add ! to any macro displaying text, and the first character in the text will be changed to an capital character. For example: %B will show as october but %!B will show as October.