Layer | AS_Layer |
Object | ASDate |
Date objects represent a particular date and time. All date objects are guaranteed to give accurate representation of UTC time (not adjusted for leap seconds, as the addition of leap seconds to the international calendar does not happen according to a well-defined rule).
The related ASTimeSpan object represents an exact time span, measured in seconds.
Methods allow you to set, clear, compare, add, and subtract dates and times in various formats.
Typedef | ||
---|---|---|
ASDate
An opaque object holding information for a particular date and time. All ASDate objects are guaranteed to give accurate representation of UTC time, unadjusted for leap seconds. This is due to the fact that the introduction of leap seconds to the international calendar does not happen according to a well-defined rule.
|
Enumeration | ||
---|---|---|
ASDateTimeFormat
A constant indicating a string format for representing a date and time.
|
Method | ||
---|---|---|
Adds a calendar time span to a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object.
|
||
Adds a time span (an exact number of seconds) to a date. It modifies the date by the length of time provided in the ASTimeSpan object.
|
||
Calculates the difference between two ASDate objects and stores the result in the provided ASCalendarTimeSpan object. 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 ASDateClear(ASDate retVal)
Reinitializes a date object to the newly-allocated state, as returned by ASDateNew().
|
||
Tests whether one date is earlier or later than another.
|
||
Copies date and time data from one date object to another.
|
||
void ASDateDestroy(ASDate date)
Releases and destroys a date object.
|
||
Creates a new date object containing the same data as an existing date object.
|
||
Calculates the exact difference in seconds between two date objects and stores the result in the provided ASTimeSpan object. If date1 is earlier than date2, the result is negative.
|
||
ASTimeRec ASDateGetLocalTime(const ASDate date)
Creates a time record that represents the local time represented by the date object. The resulting local time might not account for daylight savings time correctly if the date object has been modified by adding or substracting a time span or calendar time span. It raises an exception if there is not enough memory.
|
||
Creates a time string from a date object according to a specified format. If time zone information is available in the date object, the string contains the local time along with the time zone adjustment, if that is supported by the requested format. It raises an exception if there is not enough memory.
|
||
ASTimeRec ASDateGetUTCTime(const ASDate date)
Creates a time record that represents the UTC time represented by the date object. It raises an exception if there is not enough memory.
|
||
ASDate ASDateNew()
Creates a date object. The newly allocated object reflects the epoch time: Jan 1 1970 00:00:00 UTC.
|
||
void ASDateSetLocalTimeOffset(ASDate date)
Sets a date object's local time offset according to the operating system's current time zone information. Different operating systems handle daylight savings differently. This method causes the date object to always use the same daylight savings time offset that the operating system is currently using, even if the date object is modified.
|
||
Initializes a date object from a time record. It raises an exception if the time structure represents an invalid time, such as January 32nd 1999 or Feb 29th 2001. It assumes that the parameters for the day and month in the time record are 1-based.
|
||
Initializes a date object from a time string. It raises an exception if there is not enough memory, if the format is unrecognized, or if the time string is not formatted according to the supplied format.
|
||
void ASDateSetToCurrentLocalTime(ASDate date)
Sets a date object to the current local time, using the time zone information from the operating system.
|
||
void ASDateSetToCurrentUTCTime(ASDate retVal)
Sets a date object to the current UTC time with no time zone information.
|
||
Subtracts a calendar time span from a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object.
|
||
Subtracts a time span (an exact number of seconds) from a date. It modifies the date by the length of time provided in the ASTimeSpan object.
|
ASDate |
Product availability: All |
Platform availability: All |
typedef struct _t_ASDateRec* ASDate;
An opaque object holding information for a particular date and time. All ASDate objects are guaranteed to give accurate representation of UTC time, unadjusted for leap seconds. This is due to the fact that the introduction of leap seconds to the international calendar does not happen according to a well-defined rule.
See Also
File: ASExpT.h |
Line: 4046 |
ASDateTimeFormat |
Product availability: All |
Platform availability: All |
enum ASDateTimeFormat {
kASTimeNone = 0,
kASTimePDF,
kASTimeUniversal,
kASTimeUniversalH,
kASTimeUTC_ASN1,
kASTimeGENERALIZED_ASN1
}
File: ASExpT.h |
Line: 4019 |
ASDateAddCalendarTimeSpan | () |
Product availability: All |
Platform availability: All |
void ASDateAddCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan)
Adds a calendar time span to a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object.
Parameters
date — | The date. |
|
timeSpan — | The calendar time span to add. |
See Also
Since
File: ASExtraProcs.h |
Line: 1870 |
ASDateAddTimeSpan | () |
Product availability: All |
Platform availability: All |
void ASDateAddTimeSpan(ASDate date, const ASTimeSpan timeSpan)
Adds a time span (an exact number of seconds) to a date. It modifies the date by the length of time provided in the ASTimeSpan object.
Parameters
date — | The date. |
|
timeSpan — | The time span to add. |
See Also
Since
File: ASExtraProcs.h |
Line: 1895 |
ASDateCalendarDiff | () |
Product availability: All |
Platform availability: All |
void ASDateCalendarDiff(const ASDate date1, const ASDate date2, ASCalendarTimeSpan result)
Calculates the difference between two ASDate objects and stores the result in the provided ASCalendarTimeSpan object. 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
date1 — | The first date. |
|
date2 — | ||
result — | The calendar time span structure in which to store the difference. |
See Also
Since
File: ASExtraProcs.h |
Line: 1912 |
ASDateClear | () |
Product availability: All |
Platform availability: All |
void ASDateClear(ASDate retVal)
Reinitializes a date object to the newly-allocated state, as returned by ASDateNew().
Parameters
retVal — | The date object. |
See Also
Since
File: ASExtraProcs.h |
Line: 1700 |
ASDateCompare | () |
Product availability: All |
Platform availability: All |
Tests whether one date is earlier or later than another.
Parameters
date1 — | The first date. |
|
date2 — |
|
See Also
Since
File: ASExtraProcs.h |
Line: 2095 |
ASDateCopy | () |
Product availability: All |
Platform availability: All |
Copies date and time data from one date object to another.
Parameters
original — | The date to be copied. |
|
copy — |
See Also
Since
File: ASExtraProcs.h |
Line: 1711 |
ASDateDestroy | () |
Product availability: All |
Platform availability: All |
void ASDateDestroy(ASDate date)
Releases and destroys a date object.
Parameters
date — | The date. |
See Also
Since
File: ASExtraProcs.h |
Line: 1721 |
ASDateDup | () |
Product availability: All |
Platform availability: All |
Creates a new date object containing the same data as an existing date object.
Parameters
date — | The date to duplicate. |
The new date object. |
See Also
Since
File: ASExtraProcs.h |
Line: 1690 |
ASDateExactDiff | () |
Product availability: All |
Platform availability: All |
void ASDateExactDiff(const ASDate date1, const ASDate date2, ASTimeSpan result)
Calculates the exact difference in seconds between two date objects and stores the result in the provided ASTimeSpan object. If date1
is earlier than date2
, the result is negative.
Parameters
date1 — | The first date. |
|
date2 — | ||
result — | The time span structure in which to store the difference. |
See Also
Since
File: ASExtraProcs.h |
Line: 1928 |
ASDateGetLocalTime | () |
Product availability: All |
Platform availability: All |
Creates a time record that represents the local time represented by the date object. The resulting local time might not account for daylight savings time correctly if the date object has been modified by adding or substracting a time span or calendar time span. It raises an exception if there is not enough memory.
Parameters
date — | The date. |
The newly created time record. |
See Also
Since
File: ASExtraProcs.h |
Line: 1976 |
ASDateGetTimeString | () |
Product availability: All |
Platform availability: All |
char* ASDateGetTimeString(const ASDate date, ASDateTimeFormat format)
Creates a time string from a date object according to a specified format. If time zone information is available in the date object, the string contains the local time along with the time zone adjustment, if that is supported by the requested format. It raises an exception if there is not enough memory.
It is the client's responsibility to release the memory associated with the returned string using ASfree().
Parameters
date — | The date object. |
|
format — | The format of the time string. |
The time string in the specified format. |
See Also
Since
File: ASExtraProcs.h |
Line: 1947 |
ASDateGetUTCTime | () |
Product availability: All |
Platform availability: All |
Creates a time record that represents the UTC time represented by the date object. It raises an exception if there is not enough memory.
Parameters
date — | The date object. |
The newly created time record. |
See Also
Since
File: ASExtraProcs.h |
Line: 1961 |
ASDateNew | () |
Product availability: All |
Platform availability: All |
ASDate ASDateNew()
Creates a date object. The newly allocated object reflects the epoch time: Jan 1 1970 00:00:00 UTC.
Raises an exception if there is not enough memory for the operation.
ReturnsThe newly created date object. |
See Also
Since
File: ASExtraProcs.h |
Line: 1679 |
ASDateSetLocalTimeOffset | () |
Product availability: All |
Platform availability: All |
void ASDateSetLocalTimeOffset(ASDate date)
Sets a date object's local time offset according to the operating system's current time zone information. Different operating systems handle daylight savings differently. This method causes the date object to always use the same daylight savings time offset that the operating system is currently using, even if the date object is modified.
Parameters
date — | The date. |
See Also
Since
File: ASExtraProcs.h |
Line: 1801 |
ASDateSetTimeFromRec | () |
Product availability: All |
Platform availability: All |
Initializes a date object from a time record. It raises an exception if the time structure represents an invalid time, such as January 32nd 1999 or Feb 29th 2001. It assumes that the parameters for the day and month in the time record are 1
-based.
Parameters
date — | The date object. |
|
timeRec — | The time record. |
See Also
Since
File: ASExtraProcs.h |
Line: 1834 |
ASDateSetTimeFromString | () |
Product availability: All |
Platform availability: All |
void ASDateSetTimeFromString(ASDate date, const char* timeString, ASDateTimeFormat format)
Initializes a date object from a time string. It raises an exception if there is not enough memory, if the format is unrecognized, or if the time string is not formatted according to the supplied format.
Parameters
date — | The date object. |
|
timeString — | The time string, in the specified format. |
|
format — | The format of the time string. kASTimeNone and kASTimeUniversalH are not supported. |
See Also
Since
File: ASExtraProcs.h |
Line: 1818 |
ASDateSetToCurrentLocalTime | () |
Product availability: All |
Platform availability: All |
void ASDateSetToCurrentLocalTime(ASDate date)
Sets a date object to the current local time, using the time zone information from the operating system.
Parameters
date — | The date. |
See Also
Since
File: ASExtraProcs.h |
Line: 1787 |
ASDateSetToCurrentUTCTime | () |
Product availability: All |
Platform availability: All |
void ASDateSetToCurrentUTCTime(ASDate retVal)
Sets a date object to the current UTC time with no time zone information.
Parameters
retVal — | The date. |
See Also
Since
File: ASExtraProcs.h |
Line: 1775 |
ASDateSubtractCalendarTimeSpan | () |
Product availability: All |
Platform availability: All |
void ASDateSubtractCalendarTimeSpan(ASDate date, const ASCalendarTimeSpan timeSpan)
Subtracts a calendar time span from a date. It modifies the date by the length of time provided in the ASCalendarTimeSpan object.
Parameters
date — | The date. |
|
timeSpan — | The calendar time span to subtract. |
See Also
Since
File: ASExtraProcs.h |
Line: 1855 |
ASDateSubtractTimeSpan | () |
Product availability: All |
Platform availability: All |
void ASDateSubtractTimeSpan(ASDate date, const ASTimeSpan timeSpan)
Subtracts a time span (an exact number of seconds) from a date. It modifies the date by the length of time provided in the ASTimeSpan object.
Parameters
date — | The date. |
|
timeSpan — | The time span to subtract. |
See Also
Since
File: ASExtraProcs.h |
Line: 1882 |