v Main
-> Latest
-> About
-> Photos
-> WebCam
-> Words
-> Graphics
-> AMPlay
-> SpriteUtils
-v Recurse
-> BitField
-v Diary
-v Macros
-> Options
-> Scripts
-> History
-> Fan
-> Icons
-> Music
-> Links
-> Credits

> Site Map



RISC OS applications have a built in standard for referring to date and time information. This is detailed in the RISC OS 3 (and presumably later) manual, as part of the documentation for the Alarm application. Organizer also supports this format, as may other RISC OS applications.

Diary currently supports some of it, but not all, as we'll see below. It also has a few additions of its own, some for convenience, and some for necessity as it needs to encode information other than the date.

First, the list of RISC OS macros:

NameMeaningTypical valueSupported by Diary?
minutes05Y 1
hours in 12 hour format07Y 1
hours in 24 hour format23Y 1
'AM' or 'PM'PMY 1
weekday in fullSundayY
weekday in three charactersSunY
weekday as a number7Y
day of the month26Y
appropriate suffixthY 2
month name in fullMarchY
month name in three charactersMarY
month as a number3Y
century as two digits20Y
year within century00Y
week within year12Y 3
day within year86Y
insert a null character-N
insert a percentage sign%Y 4

1: Time macros always return the current time, are only useful in certain circumstances - creating a new entry, setting a last modified date etc. Don't use them in loops - it doesn't work.
2: This returns the suffix appropriate to the most recently used numeric value.
3: Week 1 is taken as the week which commences with the first Monday in January.
4: Also, '%' on its own will insert a '%' as long as it doesn't form part of a recognised macro.

In addition to the above named macros, RISC OS also includes support for a modifier prefix, 'z'. This has the effect of removing any leading zero(es) from a numeric value. It only affects the macro which contains it.

As an example;

%we the %dy%st of %mo
might be
Monday the 06th of March

whereas, with the 'z' modifier;

%we the %zdy%st of %mo
would be
Monday the 6th of March

Still with me?

In Diary, the 'z' modifier can be applied to most numeric values - day of year, week of year, hour etc, but not year, century etc.

Additional macros that Diary uses;

NameMeaningTypical value
century as four digits2000 1
year as four digits2000 1
name of current diary entryvaries
name of next diary entryvaries
name of previous diary entryvaries
name of first diary entry in current monthvaries
name of last diary entry in current monthvaries
!Diary's version string0.06 1.5.2000

1: These macros have been added to make it simpler to refer to four digit years. Currently the century and year are identical, but next year the year will change while the century will not.

The '%e?' macros return the name of the relevant entry - whether it gives names or numbers, and whether it has leading zeroes or not will depend on the journal naming options in the options file.

Additional modifiers that Diary supports;

The additional modifiers are 'u' and 'l'. These have the effect of forcing the output to entirely UPPER or lower case as appropriate. The default for all the text output is Leading Capitals, except for the suffix, which is lower case unless you use the 'u' modifier.

The macros themselves are not case-sensitve - %we and %WE are equivalent.

< Diary. ^ Top.

Valid HTML 4.01 Copyright © 2006 Mike Sandells.
Last Modified: 12.7.2006