System.Date

Report any suspected bugs that you find
Post Reply
gray
Posts: 71
Joined: Tue Feb 12, 2019 2:59 am
Location: Mauritius

System.Date

Post by gray » Sun Apr 11, 2021 8:05 am

Embedded Oberon's System.Date runs these checks on input data to set the clock:

Code: Select all

IF (day >= 1) & (day < 31) & (mo >= 1) & (mo <= 12) & (yr >= 2000) & (yr <= 2099) THEN
However, the year gets encoded into six bits with a 32 bit INTEGER, ie. only allowing years up to 2063. This can easily be checked by entering a year above 2063, which will roll over to a lower value. Also, the day check should include 31.

Hence, I suggest the check should read:

Code: Select all

IF (day >= 1) & (day <= 31) & (mo >= 1) & (mo <= 12) & (yr >= 2000) & (yr <= 2063) THEN
Also

Code: Select all

System.Date 11.04.2021 13:23:33
does not seem to work OMM. Before the August 2020 release of EO, "/" was the date delimiter, but was changed to ".", according to the comments in module System. "/" still works, however. FWIW, Texts.WriteClock uses "." as well.

Project Oberon's System.Date does not run any range checks.

Post Reply