RISC World

D. Date and Time Format

You may insert the current time and date into Ovation documents very simply using the following keypresses:
  • Shift Insert         insert time
  • Insert         insert date
  • Shift Ctrl Insert      insert time and date
Please note that time and date are inserted as ordinary text strings. They record the time and date registered by the computer's internal clock when they were inserted into the text and they are not updated.

The default formats are:

  • time:         8:34pm
  • date:         30th October 1990
  • time and date:      30th October 1990 8:35pm
The formats are controlled by two system variables called Ovation$TimeFormat and Ovation$DateFormat whose values are set by the Ovation !Run file when Ovation is started. If you would prefer to use a different format, you should load the Ovation !Run file into Edit and customise the lines which read:
    Set Ovation$DateFormat %ZDY%ST %MO %CE%YR
    Set Ovation$TimeFormat %Z12:%MI%AM
 
These variables are made up as follows. Each field represents a component of the string to be printed. If a component does not begin with a % character, that component is sent to the string as it stands. In the above examples note the two spaces in the date format and the colon in the time format. You could add commas or dashes to separate components if you prefer.

If a component is prefaced by a % it is a code representing data to be processed from the computer's internal clock and calendar. If a Z follows immediately after the %, leading zeros are suppressed.

The following codes are recognised:

   Name          Value                Example
  --------------------------------------------
    CS   centi-seconds                  99
    SE   seconds                        59
    MI   minutes                        05
    12   hours in 12-hour format        07
    24   hours in 24-hour format        23
    AM   'am' or 'pm'                   am
    PM   'am' or 'pm'                   pm
    WE   weekday, in full             Thursday
    W3   weekday, first three letters   Thu
    WN   weekday, as a number           5
    DY   day of month                   01
    ST   'st', 'nd', 'rd' or 'th'       st
    MO   month, in full               January
    M3   month, first three letters     Jan
    MN   month, as a number             01
    CE   century                        19
    YR   year within century            91
    WK   week of the year               52