Routines for c_time.kb


AdjForNewBase

File Name

c_time.kb

Syntax

AdjForNewBase ( VAR IsUserOverride: BOOLEAN )

Parameters

IsUserOverride - TRUE = user has a set override; FALSE = user does not have a set override

Returns

None

Side Effects

None

Description

Sets the GMTBias to a new value.

Dialog Forms Called

None


CheckForNewOffsetBase

File Name

c_time.kb

Syntax

CheckForNewOffsetBase

Parameters

None

Returns

None

Side Effects

Daylight savings adjustment is performed. This is already been taken into consideration when the local time is taken from the system clock. So the new base zone needs to be adjusted.

Description

Checks for a GMT base override in SAI_APP_PARAMS and adjusts the GMTBias accordingly.

Dialog Forms Called

None


cmnTimeStamp

File Name

c_time.kb

Syntax

cmnTimeStamp

Parameters

None

Returns

Integer - a new time stamp

Side Effects

None

Description

Generates a common time stamp.

Dialog Forms Called

None


cmnTimeToInteger

File Name

c_time.kb

Syntax

cmnTimeToInteger ( VAL t: TIME )

Parameters

t - time passed in

Returns

Integer - converts time to integer

Side Effects

None

Description

Converts the time to an integer in seconds.

Dialog Forms Called

None


DateTimeDif

File Name

c_time.kb

Syntax

DateTimeDif ( VAL d2: DATE, VAL t2: TIME, VAL d1: DATE, VAL t1: TIME )

Parameters

d2 - date

t2 - time

d1 - date

t1 - time

Returns

Integer - the differences reflected in seconds

Side Effects

None

Description

Calculates the difference between 2 sets of date/times.

Dialog Forms Called

None


GetLocationTime

File Name

c_time.kb

Syntax

GetLocationTime ( VAL location_id: STRING, VAL timezone_id: STRING, VAL localTz: TimeZonesRecord, VAL daylight_active: BOOLEAN )

Parameters

location_id -

timezone_id -

localTz -

daylight_active - flag indicating if database is on daylight savings time currently

Returns

None

Side Effects

None

Description

A total number of seconds are passed in and the string passed out contains a time in HH:MM:SS.

Dialog Forms Called

None


GetTimeZoneInfo

File Name

c_time.kb

Syntax

GetTimeZoneInfo

Parameters

None

Returns

None - sets up global variables used in GMT conversion

Side Effects

None

Description

Publically declared so as to only read this in one time.

Dialog Forms Called

None


GMTDateOnly

File Name

c_time.kb

Syntax

GMTDateOnly: DATE

Parameters

None

Returns

Current GMT Date

Side Effects

None

Description

This function is used to return the current GMT date. It can also be used as a direct replacement for $today.

Dialog Forms Called

None


GMTTime

File Name

c_time.kb

Syntax

GMTTime ( REF d: DATE, REF t: TIME )

Parameters

d - date

t - time

Returns

None

Side Effects

None

Description

Returns Greenwich Mean Time.

Dialog Forms Called

None


GMTTimeOnly

File Name

c_time.kb

Syntax

GMTTimeOnly: TIME

Parameters

None

Returns

Current GMT Time

Side Effects

None

Description

This function is used to return the current GMT Time. It can also be used as a direct replacement for $Now.

Dialog Forms Called

None


GMTUserBaseOffset

File Name

c_time.kb

Syntax

GMTUserBaseOffset

Parameters

None

Returns

None

Side Effects

None

Description

Sets the GMTBias to a new value if the base time zone is set to something other than GMT. It then adjusts the GMT Offset base in a combination of scenarios between a new base and user overrides.

Dialog Forms Called

None


IntegerToHMS

File Name

c_time.kb

Syntax

IntegerToHMS ( VAL secs: INTEGER )

Parameters

secs - seconds

Returns

None

Side Effects

None

Description

A total number of seconds are passed in and the string passed out contains a time in HH:MM:SS.

Dialog Forms Called

None


OffsetSecondsToTime

File Name

c_time.kb

Syntax

OffsetSecondsToTime ( VAL seconds: INTEGER )

Parameters

seconds - integer containing seconds difference value

Returns

Integer - containing hour difference in hours

Side Effects

None

Description

This function converts a time zone second difference to hours and adjusts it by one hour if daylight savings is active.

Dialog Forms Called

None


OffsetTimeToSeconds

File Name

c_time.kb

Syntax

OffsetTimeToSeconds ( VAL hour_difference: INTEGER )

Parameters

hour_difference - integer containing hour difference value

Returns

Integer - containing hour difference in seconds

Side Effects

None

Description

This function converts a time zone hour difference to seconds.

Dialog Forms Called

None


SAI_DatetimeInit

File Name

c_time.kb

Syntax

SAI_DatetimeInit

Parameters

None

Returns

None

Side Effects

None

Description

Gets the database date and times.

Dialog Forms Called

None


SAI_TimestampDbToGMT

File Name

c_time.kb

Syntax

SAI_TimestampDbToGMT ( VAL TimestampIn: INTEGER )

Parameters

Time stamp normalized to PC time

Returns

Time stamp normalized to GMT

Side Effects

None

Description

Gives a timestamp relative to Greenwich Mean Time. The database stores the data in an HH:MM format so 430 IS 4 hours and 30 min NOT 430 minutes. Also the correction time is an integer that represents minutes.

Dialog Forms Called

None


SAI_TimestampPcToDb

File Name

c_time.kb

Syntax

SAI_TimestampPcToDb ( VAL TimestampIn: INTEGER )

Parameters

TimestampIn - integer

Returns

Integer - returns integer as difference between db and pc

Side Effects

None

Description

Calculates the difference between the PC and DB time stamps.

Dialog Forms Called

None


TimeStamp

File Name

c_time.kb

Syntax

TimeStamp

Parameters

None

Returns

Integer - returns time stamp

Side Effects

Calls cmnTimeStamp

Description

Calls cmnTimeStamp to get a time stamp.

Dialog Forms Called

None


TimeToInteger

File Name

c_time.kb

Syntax

TimeToInteger ( VAL t: TIME )

Parameters

t - time

Returns

Integer - returns time in seconds

Side Effects

None

Description

This calls the function in eacommon.kb. It is here for backward compatibility.

Dialog Forms Called

None