This topic will show how to create UNIX timestamp as alarms text.
'11CV – ten thousands part of number of days since 1 January 1970 expressed in second
'12CV – thousands and hundreds part os number of days since 1 January 1970 expressed in second
'13CV – tens and ones part of number of days since 1 January 1970 expressed in second
'14CV – initial 4 digits of UNIX time
'15CV – today number of seconds
'16CV – initial number of seconds from number of days plus today
'17CV – adjusted 4 digits of UNIX time stamp using overflow from number of seconds
'18CV – adjusted 6 digits of UNIX time stamp
RA(DATA:10MB,ALARMS:W144)5S LOGONA
'Work out current days since 1/1/70 (unix 0)
'-------------------------------------------------
12SV(=10CV) 'days since 1/1/89
10CV=10CV+6940 'add difference between 1/1/89 and 1/1/70 (6940)
'Split number of days to keep within the DT number limit when processing
'-----------------------------------------------------------------------
11CV(W)=(10CV-(10CV%10000))*8.64
12CV(W)=((10CV%10000)-(10CV%100))*864
13CV(W)=((10CV%100)-(10CV%1))*86400
'Build first 4 digits (subtotal)
'--------------------------------
14CV("Initial 4 digits",W)=(11CV/100)+((12CV-12CV%10000)/10000)+((13CV-13CV%1000000)/1000000)
'Build last 6 digits (subtotal)
'-------------------------------
T("Current Seconds",=15CV,W)
16CV("Initial last digits",W)=((12CV%10000)*100)+(13CV%1000000)+15CV
'Finalise both first 4 digits and last 6 digits
'----------------------------------------------
17CV("Adjusted 4 digits",W)=14CV+(16CV-16CV%1000000)/1000000
18CV("Adjusted 6 digits",W)=16CV%1000000
'Get padding for the middle of timestamp, if last 6 digits is small enough
'-------------------------------------------------------------------------
IF(18CV<10){11$="00000"}
IF(18CV><10,100){11$="0000"}
IF(18CV><100,1000){11$="000"}
IF(18CV><1000,10000){11$="00"}
IF(18CV><10000,100000){11$="0"}
IF(18CV><100000,1000000){11$=""}
'Alarm Construction
'---------------------
DO1"Timestamp = ?17F0?11$?18F0^M^J"
Notes:
The UNIX timestamp must be stored as alarm text.
Best regards,
Rudy Gunawan
This topic will show how to create UNIX timestamp as alarms text.
````
'11CV – ten thousands part of number of days since 1 January 1970 expressed in second
'12CV – thousands and hundreds part os number of days since 1 January 1970 expressed in second
'13CV – tens and ones part of number of days since 1 January 1970 expressed in second
'14CV – initial 4 digits of UNIX time
'15CV – today number of seconds
'16CV – initial number of seconds from number of days plus today
'17CV – adjusted 4 digits of UNIX time stamp using overflow from number of seconds
'18CV – adjusted 6 digits of UNIX time stamp
RA(DATA:10MB,ALARMS:W144)5S LOGONA
'Work out current days since 1/1/70 (unix 0)
'-------------------------------------------------
12SV(=10CV) 'days since 1/1/89
10CV=10CV+6940 'add difference between 1/1/89 and 1/1/70 (6940)
'Split number of days to keep within the DT number limit when processing
'-----------------------------------------------------------------------
11CV(W)=(10CV-(10CV%10000))*8.64
12CV(W)=((10CV%10000)-(10CV%100))*864
13CV(W)=((10CV%100)-(10CV%1))*86400
'Build first 4 digits (subtotal)
'--------------------------------
14CV("Initial 4 digits",W)=(11CV/100)+((12CV-12CV%10000)/10000)+((13CV-13CV%1000000)/1000000)
'Build last 6 digits (subtotal)
'-------------------------------
T("Current Seconds",=15CV,W)
16CV("Initial last digits",W)=((12CV%10000)*100)+(13CV%1000000)+15CV
'Finalise both first 4 digits and last 6 digits
'----------------------------------------------
17CV("Adjusted 4 digits",W)=14CV+(16CV-16CV%1000000)/1000000
18CV("Adjusted 6 digits",W)=16CV%1000000
'Get padding for the middle of timestamp, if last 6 digits is small enough
'-------------------------------------------------------------------------
IF(18CV<10){11$="00000"}
IF(18CV><10,100){11$="0000"}
IF(18CV><100,1000){11$="000"}
IF(18CV><1000,10000){11$="00"}
IF(18CV><10000,100000){11$="0"}
IF(18CV><100000,1000000){11$=""}
'Alarm Construction
'---------------------
DO1"Timestamp = ?17F0?11$?18F0^M^J"
````
Notes:
The UNIX timestamp must be stored as alarm text.
Best regards,
Rudy Gunawan