RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Downloads | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

Previous|Next

  • Tickets
  • » Ticket #230

Ticket #230 (Fixed)Tue Jan 12 01:01:54 UTC 2010

UK territory, TimeZone<>0: Setting date only sets UTC date, not local date

Reported by: Kade Hansson (362) Severity: Normal
Part: RISC OS: Module Release:
Milestone: Status Fixed

Details by Kade Hansson (362):

System under test: RISC OS 5.xx, UK Territory, TimeZone(z)<>0

Description of problem:

If you set the date part of the clock ONLY on system under test, it appears to set the UTC date in the base clock, not the local date. This is not documented anywhere, and seems counter intuitive. The naive justification is that the UK territory is only for use in the United Kingdom, which has a local time which happens to correpsond to UTC most of the year round (and as the BST flag is implemented by the territory for the +1 offset part of the year, that also appears to work correctly). But this is not the case in practice- all RISC OS English speakers around the world use this territory.

When z>0, if you try and set the date part of the clock ONLY with local time between 0:00 and z:00, and local time is in advance of UTC by z hours, the effect is to advance the clock into the next day. Similarly, for z<0, if you try and set the date part of the clock ONLY with local time between (24+z):00 and 0:00, and local time is in retrograde to UTC by z hours, the effect is to retreat the clock into the previous day.

This behaviour is exhibited by the ClockFixer application by Hilary and Matthew Phillips, but it is also exhibited by the simplified Obey script which follows.

Code example to reproduce problem:

| INSTALL ON IYONIX ONLY
RMEnsure UtilityModule 5.00 Obey
RMEnsure UtilityModule 5.16 Set Sys$ClockFix True

If “<Sys$ClockFix>”<>“True” Then Obey

If it’s an even decade, the year is OK
If VAL/10 MOD 2 = 0 Then Obey

If it’s xxx0 or xxx1, the year is OK
If VAL < 2 Then Obey

Subtract 2 from the year SetEval Sys$Year STR(VAL("<Sys$Year>")-2)

Instructions to reproduce problem:

On an Iyonix system (running unpatched RISC OS 5.15 or prior) where the date is incorrectly advanced by HAL to 2012 in 2010, 2013 in 2011, etc., running this script at boot up during the affected range of hours will not only correct the year back to 2010, 2011, etc. but it will also advance (retreat) the date (i.e. day, and as a result, possibly month).

Further comments to code example:

The Sys$Date and Sys$Year implementations are particularly egregious, as they return local dates, but set UTC dates.

Workaround:

I have written a workaround, but it’s pretty horrendous (as one might expect). I can submit if it would help, but I assume that ClockFixer is only a temporary fix in itself.

Changelog:

Modified by Kade Hansson (362) Tue, January 12 2010 - 01:09:52 GMT

  • Attachment added: ClockFix

The real Obey file is attached. The “acronym detector” seems to be munging the output…

| INSTALL ON IYONIX ONLY

RMEnsure UtilityModule 5.00 Obey

RMEnsure UtilityModule 5.16 Set Sys$ClockFix True

If “<Sys$ClockFix>”<>“True” Then Obey

| If it’s an even decade, the year is OK

If VAL (“<Sys$Year>” RIGHT 3)/10 MOD 2 = 0 Then Obey

| If it’s xxx0 or xxx1, the year is OK

If VAL (“<Sys$Year>” RIGHT 1) < 2 Then Obey

| Subtract 2 from the year

SetEval Sys$Year STR (VAL (“<Sys$Year>”) -2)

Modified by Sprow (202) Sun, March 24 2013 - 14:52:03 GMT

  • Status changed from Open to Fixed

Fixed in Kernel-5_35-4_79_2_185

  • Comment on, or change status of, this ticket

Previous|Next

Search tickets

Social

Follow us on and

ROOL Store

Buy RISC OS Open merchandise here, including SD cards for Raspberry Pi and more.

Donate! Why?

Help ROOL make things happen – please consider donating!

RISC OS IPR

RISC OS is an Open Source operating system owned by RISC OS Developments Ltd and licensed primarily under the Apache 2.0 license.

Options

  • Tickets
  • New ticket
  • Milestones
  • Subversion: Changesets
  • Subversion: Browse
  • CVS: Revisions
  • CVS: Browse
  • Search

RSS feeds Rss

  • Tickets
  • Everything!
  • More feeds...
Site design © RISC OS Open Limited 2018 except where indicated
The RISC OS Open Collaboa theme is distantly based on the Collaboa default layout

Valid XHTML 1.0  |  Valid CSS

Powered by Collaboa
This site runs on Rails

Hosted by Arachsys