Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

StringToTimeZone Function

Overview

The StringToTimeZone function parses a standard time zone string and returns formatted information.

Syntax/Parameters

Syntax

dword = StringToTimeZone ( string data );

Parameters

data

A string in the form of a time zone appendage such as “+0500” or “z”.

Return Value

Returns a dword as formatted time zone information or returns a formatted error code. Formatted error codes will contain either ERROR_RANGE or ERROR_SYNTAX with an ORed subfield of 1, 2 or 3 depending on the location of the error.

Remarks

StringToTimeZone can be used to parse the zone information as part of a formatted email date or ISO-8601. Data is returned in the form of a word with the following bits set depending on the source data:

  Value   Bitwise   Description  
  STTZ_MODE_MASK   0xC000   Mode Mask (Z + or -)   
  STTZ_UTC   0x2000   Specified as 'Z' or UTC  
  STTZ_PLUS   0x4000   Zone Offset Specified as '+'  
  STTZ_MINUS   0xC000   Zone Offset Specified as '-'  
  STTZ_MINUTES   0x003F   Zone Number Minutes  
  STTZ_HOURS   0x3F00   Zone Number of Hours  

 

For example:

Source “+0500”

Results in:

0x00004500

As:

STTZ_PLUS for ‘+’

STTZ_HOURS masked as 0x500 or 5 hours

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic