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 epochs

BS2000 extends the TODR by TODR epochs. This enables a system time to be displayed up to 4317-03-18 02:44:48.587775.

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 parameter (also referred to as “Epoch Designator”) 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]. GTIME (and also the SHOW-SYSTEM-INFORMATION command) supply the current EPOCH value as feedback. Programs which themselves calculate using the TODR can use the algorithm described in the section "Calculating with TODR epochs".

The EPOCH parameter consists of two hexadecimal digits, <epc><epo>:

  • The first hexadecimal digit (<epc>, “Epoch Counter”) specifies one of the disjunct main epochs from TODR in ascending order

  • The second hexadecimal digit (<epo>, “Epoch Offset”) specifies, in ascending order, a TODR epoch which begins in the main epoch determined by <epc> and extends into the next main epoch, in other words overlaps the main epochs

  • EPOCH=00 specifies the standard epoch, i.e. the period from 1900-01-01 00:00:00 to 2042-09-17 23:53:47.370495

    Figure 30: TODR epochs

This permits a smooth transition between the epochs for the system (see also the example below).

Example

The standard epoch (up to 2042-09-17 23:53:47.370495), i.e. EPOCH=00, has applied to date.

The current date is now 2030-01-02, and systems support considers it necessary to prepare the system for the expiry of the standard epoch on 2042-09-17.

This could be done, for example, using the setting EPOCH=08. The period from 1971-05-11 11:56:53.685248 to 2114-01-26 11:50:41.055743 is then set for the TODR, see the table below. Time stamps earlier than 1971-05-11 11:56:53.685248 can then no longer be compared without recalculating using the current TODR.

Theoretically the values EPOCH=01 through EPOCH=0E could be used for the changeover on 2030-01-02. However, lower EPOCH values specify an epoch which exceeds the previous epoch by just a few years. When high epoch values are used, there is a danger that time stamps which are only a few years in the past can no longer be compared directly with the current TODR.

Tables for the TODR epochs

EPOCH=

Date and time
From

Date and time
To

Value of the TODR
From

Value of the TODR To

00

1900-01-01
00:00:00.000000

2042-09-17
23:53:47.370495

00000000 00000000

FFFFFFFF FFFFF000

01

1908-12-02
19:29:36.710656

2051-08-19
19:23:24.081151

10000000 00000000

0FFFFFFF FFFFF000

02

1917-11-03
14:59:13.421312

2060-07-20
14:53:00.791807

20000000 00000000

1FFFFFFF FFFFF000

03

1926-10-05
10:28:50.131968

2069-06-12
10:22:37.502463

30000000 00000000

2FFFFFFF FFFFF000

04

1935-09-06
05:58:26.842624

2078-05-23
05:52:14.213119

40000000 00000000

3FFFFFFF FFFFF000

05

1944-08-07
01:28:03.553280

2087-04-24
01:21:50.923775

50000000 00000000

4FFFFFFF FFFFF000

06

1953-07-08
20:57:40.263936

2096-03-24
20:51:27.634431

60000000 00000000

5FFFFFFF FFFFF000

07

1962-06-09
16:27:16.974592

2105-02-24
16:21:04.345087

70000000 00000000

6FFFFFFF FFFFF000

08

1971-05-11
11:56:53.685248

2114-01-26
11:50:41.055743

80000000 00000000

7FFFFFFF FFFFF000

09

1980-04-11
07:26:30.395904

2122-12-28
07:20:17.766399

90000000 00000000

8FFFFFFF FFFFF000

0A

1989-03-13
02:56:07.106560

2131-11-29
02:49:54.477055

A0000000 00000000

9FFFFFFF FFFFF000

0B

1998-02-11
22.25:43.817216

2140-10-29
22:19:31.187711

B0000000 00000000

AFFFFFFF FFFFF000

0C

2007-01-13
17:55:20.527872

2149-09-30
17:49:07.898367

C0000000 00000000

BFFFFFFF FFFFF000

0D

2015-12-15
13:24:57.238528

2158-09-01
13:18:44.609023

D0000000 00000000

CFFFFFFF FFFFF000

0E

2024-11-15
08:54:33.949184

2167-08-03
08:48:21.319679

E0000000 00000000

DFFFFFFF FFFFF000

0F

2033-10-17
04:24:10.659840

2176-07-04
04:17:58.030335

F0000000 00000000

EFFFFFFF FFFFF000

Table 49: All TODR epochs with <epc> = 0

EPOCH=

Date and time
From

Date and time
To

Value of the TODR
From

Value of the TODR To

00

1900-01-01
00:00:00.000000

2042-09-17
23:53:47.370495

000000 00000000

FFFFFF FFFFF000

10

2042-09-17
23:53:47.370496

2185-06-04
23:47:34.740991

000000 00000000

FFFFFF FFFFF000

20

2185-06-04
23:47:34.740992

2328-02-21
23:41:22.111487

000000 00000000

FFFFFF FFFFF000

...





F0

4040-09-12
22:26:50.557440

4183-05-31
22:20:37.927935

000000 00000000

FFFFFF FFFFF000

Table 50: TODR main epochs (<epc> = 0, 1, 2, etc.)

TODR format TODX

In BS2000 the format TODX is provided for the TODR. TODX consists of a double word and contains the number of microseconds before the start of the standard epoch (1900-01-01, 00:00:00).

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

In the standard epoch TODX corresponds to a TODR whose content has been moved 12 bits to the rights. However, in contrast to the TODR (upper limit 2042-09-17 23:53:47.370495), the upper limit of TODX extends far into the future (upper limit 4317-03-18 02:44:48.587775). This upper limit is the result of the internal connection with the TODR format extended by EPD.

Calculating with TODR epochs

The algorithm below uses a specified TODR and the associated value of the EPD to calculate the number of microseconds since the start of the standard epoch (1900-01-01, 00:00), i.e. the TODX format.

:* todx: Number of microseconds since 1900-01-01 00:00:00.000000
:* todr: Value of the TODR, supplied by GTIME or CTIME
:* epd : Value of the EPD, supplied by GTIME
:* epc : Epoch Counter (first hexadecimal digit of the EPD)
:* epo : Epoch Offset (second hexadecimal digit of the EPD)
epc:=epd >> 4;
:* epc is formed from epd, moved 4 bits to the right
epo:=epd & x'0F';
:* epo is formed from epd, 4 bits on left deleted
todx:=todr >> (3*4);
:* todx is initialized from specified todr, moved 12 bits
:* to the right
if((todx >> 12*4) LT epo) epc:=epc+1;
:* when the initialized todx (moved another 48 bits to the right)
:* is less than epo, the time is in the next main epoch; 
:* epc must therefore be incremented by one.
todx:=todx + epc * x'00100000 00000000';
:* correction of the initialized todx by the value of epc

The highest possible value for TODX when epd=x'FF' and todr=x'EFFFFFFF FFFFF000' is todx=x'010EFFFF FFFFFFFF'.

The following also applies for a specified epoch EPD:

  • Start of epoch: TODX = EPC << (13*4) + EPO << (12*4) (inclusive)

  • End of epoch: TODX = (EPC+1) << (13*4) + EPO << (12*4) (exclusive)

Comment

A todr time stamp of the standard epoch as may possibly still exist in “old” data sets is easily converted to TODX format using the algorithm above and can then be compared with a TODX value from any epoch. Since in this case epd=0, the algorithm is reduced to: todx:=todr >> (3*4).