![]() |
StringToDate |
||||
Header: | DateTimeUtils.h | Carbon status: | Supported | |
Parses a string for a date and converts the date information into values in a date-time structure.
StringToDateStatus StringToDate ( Ptr textPtr, SInt32 textLen, DateCachePtr theCache, SInt32 *lengthUsed, LongDateRec *dateTime );
A pointer to the text string to be parsed. StringToDate expects a date specification, in a format defined by the current script, at the beginning of the string.
The number of bytes in the text string.
A pointer to the date cache structure initialized by the InitDateCache function with data that is used during the conversion process.
On output, contains a pointer to the number of bytes of the string that were parsed for the date. Use this value to compute the starting location of the text that you can pass to StringToTime. Alternatively, you can use them in reverse order.
On output, a pointer to the LongDateRec structure, which contains the year, month, day, and day of the week parsed for the date.
A set of bit values that indicate confidence levels, with higher numbers indicating low confidence in how closely the input string matched what the function expected. For example, specifying a date with nonstandard separators may work, but it returns a message indicating that the separator was not standard.
StringToDate parses the text string until it has finished finding all date information or until it has examined the number of bytes specified by textLen.
Note that StringToDate fills in only the year, month, day, and day of the week; StringToTime fills in the hour, minute, and second. You can use these two functions sequentially to fill in all of the values in a LongDateRec structure.
When one of the date components is missing, such as the year, the current date value is used as a default.
StringToDate may move memory; your application should not call this function at interrupt time.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)