TCA. - Time Calculation

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Date and Time Calculation > TCA. - Time Calculation >

TCA. - Time Calculation

TCA.Convert Timestamp

Previous Top Next


MiniRobotLanguage (MRL)

 

clip0952

 

TCA.Convert Timestamp

Will convert a Timestamp that uses names into a numeric timestamp

 

 

Intention

 

Will convert a timestamp that uses names like "Mar" for "March", and "Thu" for Thursday into a numeric timestamp.

Should recognize english and german names for Month and Day.

 

 

 

Syntax

 

 

TCA.Convert Timestamp|P1[|P2]

 

 

Parameter Explanation

 

P1 - Original Timestamp

P2 - (optional) Variable for result. If omitted the result is placed on TOS.

 

 

 

 

Example

 

'***********************************

' TCA.-Sample

'***********************************
'

'SPR Script-file: Twitter

'Purpose: Search Twitter Export for Posts by date

'Creation date: 12-01-2023 at 06:53:41

'===========================================================

'#EXE:?path\

'#SPI:ForceWrite

 

$$VAF=?exeloc\Tweets.txt

$$IDL=?exeloc\IDLA.txt

DEL.$$IDL

$$SEA="id" : "

$$SEB="created_at" : "

TXT.Load Text File|$$VAF|$$LIN

MBX.Lines loaded: $$LIN

$$ERO=Could not load File.

JIZ.$$LIN|Error

 

$$LIC=1

:Repeat

TXT.Find Line With|$$SEA|$$LIC|$$FDA

JIZ.$$FDA|Done

CAL.$$LIC=$$FDA+1

TXT.Find Line With|$$SEB|$$LIC|$$FDB

JIZ.$$FDB|Done

CAL.$$LIC=$$FDB+1

TXT.Get Line Trimmed|$$FDA|$$LIA

TXT.Get Line Trimmed|$$FDB|$$LIB

STR.Clip Left|$$LIB|16

STR.Clip Left|$$LIA|7

VBT.$$LIB|All

$$TRI=,"

VBT.$$LIB|$$TRI

TCA.cts|$$LIB|$$LIB

STR.Extract|$$LIB|$sp$|1|$$DAT

RPL.$$DAT|/|-

NDC.date_before|$$DAT|13-12-2023

  GTO.Repeat

EIF.

VBT.$$LIA|$$TRI

$$OUT=$$LIA$crlf$

ATF.$$IDL|$$OUT

PRT.$$FDA -> $$OUT

GTO.Repeat

:Done

MBX.We are done

ENR.

'===========================================================

:Error

MBX.$$ERO

ENX.

 

 

 

 

 

 

Remarks

 

-

 

 

Limitations:

 

-

 

 

See also: