WimpExtension document: Time                                           Doc 20
=============================================================================

Library number &22

All R0 reason codes are offset from &220000 when called via
WimpExt_CallLibrary.

R0 = &00 : Get decimal time block
---------------------------------
R1-> 8 byte block for returned data
Exit:
R1+0 = year
  +1 = month
  +2 = day
  +3 = 0
  +4 = hour
  +5 = minutes
  +6 = seconds
  +7 = 0

Reads the current UTC time in decimal format, using the system variable
WimpExt$RISCOSTimeAdjustment for RISC OS 2.

You can convert this UTC decimal time block into local time by calling reason
code 4.

R0 = &01 : Decimal time block to seconds
----------------------------------------
R1-> 8 byte time block
Exit:
R0 = number of seconds since 1st January 1900


R0 = &02 : Decimal time block to centiseconds
---------------------------------------------
R1-> 8 byte time block
R2-> 5 byte output time block
Exit:
R2+0 = time (least significant byte)
  +1 = .
  +2 = .
  +3 = .
  +4 = time (most significant byte)

R0 = &03 : Decimal time block adjustment
----------------------------------------
R1-> 8 byte time block
R2 = adjustment type
R3 = adjustment
Exit:
updated R1 block

  Adjustment types:
    0 - years
    1 - months
    2 - days
    4 - hours
    5 - minutes
    6 - seconds

This will adjust something in the time block, eg. if you go back an hour
and it is 00:30, it will go back a day too, which might cause you to go
back a month, which might cause you to go back a year. Leap years are
calculated etc.

R0 = &05 : Decimal time block in local to UTC
---------------------------------------------
R1-> 8 byte time block
Exit:
updated R1 block

The time block is updated to convert from local to UTC, eg. if in BST this
would cause the hour to be decreased by one.

R0 = &04 : Decimal time block in UTC to local
---------------------------------------------
R1-> 8 byte time block
Exit:
updated R1 block

Does the reverse of reason code 5.
