Important: The information in this document is obsolete and should not be used for new development.
DateString
TheDateString
procedure converts a date in the standard date-time representation into a Pascal string, making use of the date formatting information in the
specified resource.
PROCEDURE DateString (dateTime: LongInt; longFlag: Boolean; VAR result: Str255; intlParam: Handle );
dateTime
- The date-time value in the representation returned by the
GetDateTime
procedure.longFlag
- A flag that indicates the desired format for the date string. This is one
of the three values defined as theDateForm
type.result
- On output, contains the string representation of the date in the format indicated by the
longFlag
parameter.intlParam
- A handle to a numeric-format or a long-date-format resource that specifies date formatting information for use in the conversion. The numeric-format (
'itl0'
) resource specifies the short date formats and the long-date-format ('itl1'
) resource specifies the long date formats.DESCRIPTION
DateString
converts the long integer representation of date and time in thedateTime
parameter into a Pascal string representation of the date. You can call theGetDateTime
function to get the date-time value.GetDateTime
is described in the book Inside Macintosh: Operating System Utilities.The string produced by
DateString
is in one of three standard date formats used on the Macintosh, depending on which of the threeDateForm
values that you specify for thelongFlag
parameter:shortDate
,abbrevDate
, orlongDate
. The information in the supplied resource defines how month and day names are written and provides for calendars with more than 7 days and more than 12 months. For the Roman script system's resource, the date January 31, 1991, produces the following three strings:
Dateform value Date string produced shortDate 1/31/92 abbrevDate Fri, Jan 31, 1992 longDate Friday, January 31, 1992
DateString
formats its data according to the information in the specified numeric-format resource (for short date formats) or long-date-format resource (for long date formats). If you specifyshortDate
, theintlParam
value should be the handle to a numeric-format resource; if you specifyabbrevDate
orlongDate
, it should be the handle to a long-date-format resource. If theintlParam
value isNIL
,DateString
uses the appropriate resource from the current script.SPECIAL CONSIDERATIONS
DateString
may move memory; your application should not call this procedure at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theDateString
procedure are
Trap macro Selector _Pack6 $000E