Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

TODR epoch

&pagelevel(4)&pagelevel

BS2000 extends the TODR by a TODR epoch. This enables a system time to be displayed different from the past default range (from 1900-01-01 00:00:00.000000 to 2042-09-17 23:53:47.370495) which corresponds to the default epoch 00.

The TODR epoch for the current session is set in the startup parameter service, GTIME parameter record, EPOCH parameter, see the section "System time control (GTIME)". It cannot be changed during the session.

The epoch designation is automatically taken into account in the user macros CTIME (Time stamp calculations) and GTIME (Get date and time), see the “Executive Macros” manual [30]. The value of the current epoch designation can be obtained via the user macro GTIME and also the SHOW-SYSTEM-INFORMATION command.

To ensure that the functions GTIME and CTIME correctly interpret the TODR, even after its overflow in the year 2042, the default epoch will be changed from 00 to 08 well in advance. This will allow the representation of a date range from 1971 to 2114 (see table below).

For applications which use timestamps in TODR format, this may lead to incompatibilities and they must be adapted before changing the epoch. Therefore it is strongly recommended that applications do not store timestamps in TODR format to allow trouble-free changes of the TODR epoch.

Interpretation of TODR Time Stamps with TODR Epochs 00 and 08

TODR Time Stamp
(hex)
Date and Time Interpretation
EPOCH=00EPOCH=08
00000000 000000001900-01-01 00:00:00.0000002042-09-17 23:53:47.370496
7FFFFFFF FFFFF0001971-05-11 11:56:53.6852472114-01-26 11:50:41.055743
80000000 000000001971-05-11 11:56:53.6852481971-05-11 11:56:53.685248
FFFFFFFF FFFFF0002042-09-17 23:53:47.3704952042-09-17 23:53:47.370495

Table 49: Comparison of the current default epoch 00 and the future default epoch 08

TODX Time Stamp Format

As an alternative to the TODR format, the TODX time stamp format is also available in BS2000. TODX consists of a double word and contains the number of microseconds since 1900-01-01 00:00:00.000000. In contrast to the TODR format, the TODX format covers a much wider time span (from the year 1900 to the year 4317).

The TODX format is used/supplied by the user macros CTIME (Time stamp calculations) and GTIME (Get date and time), see the “Executive Macros” manual [30]. It is useful for epoch-independent representation of a time stamp and for calculating with time stamps from different epochs.

With the current default epoch 00, a TODX time stamp corresponded to a TODR time stamp whose content has been moved 12 bits to the right.

Programs which themselves calculate using TODR values can use the algorithms described in the section "Converting TODR time stamps to TODX time stamps".

Converting TODR time stamps to TODX time stamps

The algorithms below use a TODR value and the associated value of the epoch designation to calculate the number of microseconds since 1900-01-01 00:00:00.000000, i.e. the TODX value.

The variables and operators used are:
TODX   :  TODX value, i.e. number of microseconds since 1900-01-01 00:00:00.000000
TODR   :  TODR value
EPD    :  value of the epoch designation (1 byte)
EPC    :  epoch counter (first hexadecimal digit of EPD)
EPO    :  epoch offset (second hexadecimal digit of EPD)
x >> n :  Right-shift value x by n bits
y & y  :  AND operation (bit by bit)
Algorithm for the current default epoch designation 00:
TODX := TODR >> 12;
Algorithm for the future default epoch designation 08:
TODX := TODR >> 12;
if ((TODX >> 48) < 8)
  TODX := TODX + x'0010000000000000';
Common algorithm for any epoch designation:
TODX := TODR >> 12;
EPC  := EPD >> 4;
EPO  := EPD & x'0F';
if ((TODX >> 48) < EPO)
  EPC := EPC + 1;
TODX := TODX + EPC * x'0010000000000000';

Ranges of other TODR Epochs

EPOCHDate and Time
fromto

00

1900-01-01 00:00:00.000000

2042-09-17 23:53:47.370495

01

1908-12-02 19:29:36.710656

2051-08-19 19:23:24.081151

02

1917-11-03 14:59:13.421312

2060-07-20 14:53:00.791807

03

1926-10-05 10:28:50.131968

2069-06-21 10:22:37.502463

04

1935-09-06 05:58:26.842624

2078-05-23 05:52:14.213119

05

1944-08-07 01:28:03.553280

2087-04-24 01:21:50.923775

06

1953-07-08 20:57:40.263936

2096-03-24 20:51:27.634431

07

1962-06-09 16:27:16.974592

2105-02-24 16:21:04.345087

08

1971-05-11 11:56:53.685248

2114-01-26 11:50:41.055743

09

1980-04-11 07:26:30.395904

2122-12-28 07:20:17.766399

0A

1989-03-13 02:56:07.106560

2131-11-29 02:49:54.477055

0B

1998-02-11 22.25:43.817216

2140-10-29 22:19:31.187711

0C

2007-01-13 17:55:20.527872

2149-09-30 17:49:07.898367

0D

2015-12-15 13:24:57.238528

2158-09-01 13:18:44.609023

0E

2024-11-15 08:54:33.949184

2167-08-03 08:48:21.319679

0F

2033-10-17 04:24:10.659840

2176-07-04 04:17:58.030335