Layer | AS_Layer |
Object | ASTimeSpan |
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 | ||
---|---|---|
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 | ||
---|---|---|
_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 | ||
---|---|---|
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.
|
||
Adds two time spans, storing the result (an exact number of seconds) in another time span object.
|
||
Compares two time spans to determine if they are equal or if one represents fewer seconds than the other.
|
||
Copies data from one time span object to another.
|
||
void ASTimeSpanDestroy(ASTimeSpan timeSpan)
Releases and destroys a time span object.
|
||
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.
|
||
Gets the number of seconds from a time span object.
|
||
void ASTimeSpanNegate(ASTimeSpan timeSpan)
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.
|
||
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.
|
||
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.
|
ASCalendarTimeSpan |
Product availability: All |
Platform availability: All |
typedef _t_ASCalendarTimeSpan ASCalendarTimeSpan;
File: ASExpT.h |
Line: 4069 |
ASCalendarTimeSpanRec |
Product availability: All |
Platform availability: All |
typedef _t_ASCalendarTimeSpan ASCalendarTimeSpanRec;
File: ASExpT.h |
Line: 4069 |
ASTimeRec |
Product availability: All |
Platform availability: All |
typedef _t_ASTimeRec ASTimeRec;
File: ASExpT.h |
Line: 1308 |
ASTimeRecP |
Product availability: All |
Platform availability: All |
typedef _t_ASTimeRec ASTimeRecP;
File: ASExpT.h |
Line: 1308 |
ASTimeSpan |
Product availability: All |
Platform availability: All |
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 |
_t_ASCalendarTimeSpan |
Product availability: All |
Platform availability: All |
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 |
Year | Year. |
|
Month | Month. |
|
Day | Day. |
|
Hour | Hour. |
|
Minute | Minute. |
|
Second | Second. |
_t_ASTimeRec |
Product availability: All |
Platform availability: All |
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 |
year | Only common era years are displayed appropriately. |
|
month | Jan = |
|
date |
|
|
hour |
|
|
minute |
|
|
second |
|
|
millisecond |
|
|
day | Sun = |
|
gmtOffset | GMT offset in half hours east of Greenwich. |
ASCalendarTimeSpanAddWithBase | () |
Product availability: All |
Platform availability: All |
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 |
|
result — | The calendar time span structure in which to store the result. |
See Also
Since
File: ASExtraProcs.h |
Line: 2030 |
ASCalendarTimeSpanCompare | () |
Product availability: All |
Platform availability: All |
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 |
|
See Also
Since
File: ASExtraProcs.h |
Line: 1994 |
ASCalendarTimeSpanDiff | () |
Product availability: All |
Platform availability: All |
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 |
|
result — | The calendar time span object in which to store the difference. |
See Also
Since
File: ASExtraProcs.h |
Line: 2066 |
ASTimeSpanAdd | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 2043 |
ASTimeSpanCompare | () |
Product availability: All |
Platform availability: All |
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. |
|
See Also
Since
File: ASExtraProcs.h |
Line: 2007 |
ASTimeSpanCopy | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 1754 |
ASTimeSpanDestroy | () |
Product availability: All |
Platform availability: All |
void ASTimeSpanDestroy(ASTimeSpan timeSpan)
Releases and destroys a time span object.
Parameters
timeSpan — | The time span. |
See Also
Since
File: ASExtraProcs.h |
Line: 1763 |
ASTimeSpanDiff | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 2081 |
ASTimeSpanDup | () |
Product availability: All |
Platform availability: All |
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. |
The new time span object. |
See Also
Since
File: ASExtraProcs.h |
Line: 1745 |
ASTimeSpanGetASInt32 | () |
Product availability: All |
Platform availability: All |
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) |
The number of seconds. |
See Also
Since
File: ASExtraProcs.h |
Line: 2396 |
ASTimeSpanNegate | () |
Product availability: All |
Platform availability: All |
void ASTimeSpanNegate(ASTimeSpan timeSpan)
Negates the time span value of a time span object.
Parameters
timeSpan — | The time span. |
See Also
Since
File: ASExtraProcs.h |
Line: 2317 |
ASTimeSpanNew | () |
Product availability: All |
Platform availability: All |
ASTimeSpan ASTimeSpanNew()
Creates a time span object. It raises an exception if there is not enough memory for the operation.
ReturnsThe newly created time span object. |
See Also
Since
File: ASExtraProcs.h |
Line: 1732 |
ASTimeSpanSet | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 2141 |
ASTimeSpanSetFromASInt32 | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 2107 |
ASTimeSpanSetFromString | () |
Product availability: All |
Platform availability: All |
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
File: ASExtraProcs.h |
Line: 2123 |