LayerAS_Layer
ObjectASTimeSpan

An ASTimeSpan object represents an exact time span, measured in seconds. The internal representation uses 64-bit signed integers (to avoid the 2038 problem caused by 32-bit representation). Negative timespans are allowed.



Typedef Summary
 Typedef
 ASCalendarTimeSpan
 ASCalendarTimeSpanRec
 ASTimeRec
 ASTimeRecP
 ASTimeSpan
An ASTimeSpan represents an exact time span, measured in seconds. The internal representation uses 64-bit signed integers to avoid the year 2037 problem. Negative timespans are allowed.
Structure Summary
 Structure
 _t_ASCalendarTimeSpan
Represents a calendar time span used to calculate ambiguous time spans such as 1 year and 3 months. A calendar time span cannot be negative.
 _t_ASTimeRec
A time/date structure.
Method Summary
 Method
 
void ASCalendarTimeSpanAddWithBase(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)
Adds two calendar time spans, storing the result in another calendar time span object. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month.
 
ASInt32 ASCalendarTimeSpanCompare(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate)
Compares two calendar time spans with respect to a base date. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the comparison is made.
 
void ASCalendarTimeSpanDiff(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)
Calculates the difference between calendar time span objects and stores the result in the provided ASCalendarTimeSpan object. If timeSpan2 is less than timeSpan1, the result is negative. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month.
 
void ASTimeSpanAdd(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result)
Adds two time spans, storing the result (an exact number of seconds) in another time span object.
 
ASInt32 ASTimeSpanCompare(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2)
Compares two time spans to determine if they are equal or if one represents fewer seconds than the other.
 
void ASTimeSpanCopy(const ASTimeSpan original, ASTimeSpan copy)
Copies data from one time span object to another.
 
Releases and destroys a time span object.
 
void ASTimeSpanDiff(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result)
Calculates the exact difference in seconds between time span objects and stores the result in the provided ASTimeSpan object. If timeSpan2 is less than timeSpan1, the result is negative.
 
ASTimeSpan ASTimeSpanDup(const ASTimeSpan timeSpan)
Creates a new time span object containing the same data as an existing time span object. It raises an exception if there is not enough memory.
 
ASInt32 ASTimeSpanGetASInt32(ASTimeSpan timeSpan, ASBool* outOverflow)
Gets the number of seconds from a time span object.
 
Negates the time span value of a time span object.
 
ASTimeSpan ASTimeSpanNew()
Creates a time span object. It raises an exception if there is not enough memory for the operation.
 
void ASTimeSpanSet(ASTimeSpan timeSpan, ASInt32 highBits, ASUns32 lowBits)
The internal representation of a time span uses 64-bit signed integers (to avoid the year 2038 problem caused by 32-bit representation). This method initializes a time span object to represent a time span of x seconds, where x is the 64-bit signed integer obtained from concatenating highBits and lowBits.
 
void ASTimeSpanSetFromASInt32(ASTimeSpan timeSpan, ASInt32 numSeconds)
Initializes a time span object to represent a time span of a specific number of seconds.
 
void ASTimeSpanSetFromString(ASTimeSpan timeSpan, const char* numSecondsString)
Converts a string to a number of seconds, and initializes a time span object to represent a time span of that number of seconds. This is useful for time spans that are too long to represent with an ASInt32 value.

Typedefs Detail
ASCalendarTimeSpan 
Product availability: All
Platform availability: All

Syntax

typedef _t_ASCalendarTimeSpan ASCalendarTimeSpan;

File: ASExpT.h
Line: 4069
ASCalendarTimeSpanRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_ASCalendarTimeSpan ASCalendarTimeSpanRec;

File: ASExpT.h
Line: 4069
ASTimeRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_ASTimeRec ASTimeRec;

File: ASExpT.h
Line: 1308
ASTimeRecP 
Product availability: All
Platform availability: All

Syntax

typedef _t_ASTimeRec ASTimeRecP;

File: ASExpT.h
Line: 1308
ASTimeSpan 
Product availability: All
Platform availability: All

Syntax

typedef struct _t_ASTimeSpanRec* ASTimeSpan;

An ASTimeSpan represents an exact time span, measured in seconds. The internal representation uses 64-bit signed integers to avoid the year 2037 problem. Negative timespans are allowed.


File: ASExpT.h
Line: 4075


Structure Detail
_t_ASCalendarTimeSpan
Product availability: All
Platform availability: All

Syntax

struct _t_ASCalendarTimeSpan {
 ASUns32 Year; 
 
 ASUns32 Month; 
 
 ASUns32 Day; 
 
 ASUns32 Hour; 
 
 ASUns32 Minute; 
 
 ASUns32 Second; 
}

Represents a calendar time span used to calculate ambiguous time spans such as 1 year and 3 months. A calendar time span cannot be negative.

See Also


File: ASExpT.h
Line: 4056

Elements
Year  

Year.

 
Month  

Month.

 
Day  

Day.

 
Hour  

Hour.

 
Minute  

Minute.

 
Second  

Second.

_t_ASTimeRec 
Product availability: All
Platform availability: All

Syntax

struct _t_ASTimeRec {
 ASInt16 year; 
 
 ASInt16 month; 
 
 ASInt16 date; 
 
 ASInt16 hour; 
 
 ASInt16 minute; 
 
 ASInt16 second; 
 
 ASInt16 millisecond; 
 
 ASInt16 day; 
 
 ASInt16 gmtOffset; 
}

A time/date structure.

The millisecond field is currently unused.

See Also


File: ASExpT.h
Line: 1269

Elements
year  

Only common era years are displayed appropriately.

 
month  

Jan = 1, ..., Dec = 12.

 
date  

1..31

 
hour  

0..23

 
minute  

0..59

 
second  

0..59

 
millisecond  

0..999

 
day  

Sun = 0, ... Sat = 6.

 
gmtOffset  

GMT offset in half hours east of Greenwich. -48 signifies an unknown value.


Method Detail
ASCalendarTimeSpanAddWithBase()
Product availability: All
Platform availability: All

Syntax

void ASCalendarTimeSpanAddWithBase(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)

Adds two calendar time spans, storing the result in another calendar time span object. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month.

Parameters

timeSpan1 — 

The first calendar time span to add.

 
timeSpan2 — 

The calendar time span to add.

 
baseDate — 

The base date, or NULL to use Jan 1 1970 00:00:00, the epoch time.

 
result — 

The calendar time span structure in which to store the result.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2030
ASCalendarTimeSpanCompare() 
Product availability: All
Platform availability: All

Syntax

ASInt32 ASCalendarTimeSpanCompare(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate)

Compares two calendar time spans with respect to a base date. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the comparison is made.

Parameters

timeSpan1 — 

The first calendar time span.

 
timeSpan2 — 

The second calendar time span.

 
baseDate — 

The base date, or NULL to use Jan 1 1970 00:00:00, the epoch time.

Returns

1 if timeSpan1 > timeSpan2, 0 if they are equal, and -1 if timeSpan1 < timeSpan2.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 1994
ASCalendarTimeSpanDiff() 
Product availability: All
Platform availability: All

Syntax

void ASCalendarTimeSpanDiff(const ASCalendarTimeSpan timeSpan1, const ASCalendarTimeSpan timeSpan2, const ASDate baseDate, ASCalendarTimeSpan result)

Calculates the difference between calendar time span objects and stores the result in the provided ASCalendarTimeSpan object. If timeSpan2 is less than timeSpan1, the result is negative. Because the values in a calendar time span are not absolute (for example, a leap year has a different number of days), they are resolved with respect to the base date before the addition is done. The result is broken down into years, months, and so on, in the highest denomination possible. For example, a difference of 13 months is reported as 1 year and 1 month.

Parameters

timeSpan1 — 

The first calendar time span.

 
timeSpan2 — 

The second calendar time span.

 
baseDate — 

The base date, or NULL to use Jan 1 1970 00:00:00, the epoch time.

 
result — 

The calendar time span object in which to store the difference.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2066
ASTimeSpanAdd() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanAdd(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result)

Adds two time spans, storing the result (an exact number of seconds) in another time span object.

Parameters

timeSpan1 — 

The first time span to add.

 
timeSpan2 — 

The second time span to add.

 
result — 

The time span object in which to store the result.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2043
ASTimeSpanCompare() 
Product availability: All
Platform availability: All

Syntax

ASInt32 ASTimeSpanCompare(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2)

Compares two time spans to determine if they are equal or if one represents fewer seconds than the other.

Parameters

timeSpan1 — 

The first time span.

 
timeSpan2 — 

The second time span.

Returns

1 if timeSpan1 > timeSpan2, 0 if they are equal, and -1 if timeSpan1 < timeSpan2.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2007
ASTimeSpanCopy() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanCopy(const ASTimeSpan original, ASTimeSpan copy)

Copies data from one time span object to another.

Parameters

original — 

The time span to be copied.

 
copy — 

The time span into which the data is copied.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 1754
ASTimeSpanDestroy() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanDestroy(ASTimeSpan timeSpan)

Releases and destroys a time span object.

Parameters

timeSpan — 

The time span.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 1763
ASTimeSpanDiff() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanDiff(const ASTimeSpan timeSpan1, const ASTimeSpan timeSpan2, ASTimeSpan result)

Calculates the exact difference in seconds between time span objects and stores the result in the provided ASTimeSpan object. If timeSpan2 is less than timeSpan1, the result is negative.

Parameters

timeSpan1 — 

The first time span.

 
timeSpan2 — 

The second time span.

 
result — 

The time span object in which to store the difference.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2081
ASTimeSpanDup() 
Product availability: All
Platform availability: All

Syntax

ASTimeSpan ASTimeSpanDup(const ASTimeSpan timeSpan)

Creates a new time span object containing the same data as an existing time span object. It raises an exception if there is not enough memory.

Parameters

timeSpan — 

The time span to duplicate.

Returns

The new time span object.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 1745
ASTimeSpanGetASInt32() 
Product availability: All
Platform availability: All

Syntax

ASInt32 ASTimeSpanGetASInt32(ASTimeSpan timeSpan, ASBool* outOverflow)

Gets the number of seconds from a time span object.

Parameters

timeSpan — 

The time span object.

 
outOverflow — 

(Filled by the method) true if the number of seconds was too large to be represented by an ASInt32 value, false otherwise.

Returns

The number of seconds.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2396
ASTimeSpanNegate() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanNegate(ASTimeSpan timeSpan)

Negates the time span value of a time span object.

Parameters

timeSpan — 

The time span.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2317
ASTimeSpanNew() 
Product availability: All
Platform availability: All

Syntax

ASTimeSpan ASTimeSpanNew()

Creates a time span object. It raises an exception if there is not enough memory for the operation.

Returns

The newly created time span object.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 1732
ASTimeSpanSet() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanSet(ASTimeSpan timeSpan, ASInt32 highBits, ASUns32 lowBits)

The internal representation of a time span uses 64-bit signed integers (to avoid the year 2038 problem caused by 32-bit representation). This method initializes a time span object to represent a time span of x seconds, where x is the 64-bit signed integer obtained from concatenating highBits and lowBits.

Parameters

timeSpan — 

The time span object.

 
highBits — 

The most significant word in the desired 64-bit signed integer value.

 
lowBits — 

The least significant word in the desired 64-bit signed integer value.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2141
ASTimeSpanSetFromASInt32() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanSetFromASInt32(ASTimeSpan timeSpan, ASInt32 numSeconds)

Initializes a time span object to represent a time span of a specific number of seconds.

Parameters

timeSpan — 

The time span object.

 
numSeconds — 

The number of seconds.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2107
ASTimeSpanSetFromString() 
Product availability: All
Platform availability: All

Syntax

void ASTimeSpanSetFromString(ASTimeSpan timeSpan, const char* numSecondsString)

Converts a string to a number of seconds, and initializes a time span object to represent a time span of that number of seconds. This is useful for time spans that are too long to represent with an ASInt32 value.

Parameters

timeSpan — 

The time span object.

 
numSecondsString — 

The string containing the number of seconds. The string must consist of an optional minus sign (for negative numbers) followed by decimal digits. No white spaces are allowed anywhere in the string.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00060000

File: ASExtraProcs.h
Line: 2123