Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines / Converting Long Date and Time Values Into Strings


LongTimeString

The LongTimeString procedure converts a time that is specified as a LongDateTime value into a Pascal string, making use of the time formatting information in the
specified resource.

PROCEDURE LongTimeString(VAR dateTime: LongDateTime;
                         wantSeconds: Boolean; 
                         VAR result: Str255; intlParam: Handle);
dateTime
A 64-bit, signed representation of the number of seconds since Jan. 1, 1904.
wantSeconds
A flag that indicates whether the seconds are to be included in the resulting string.
result
On output, contains the string representation of the time.
intlParam
A handle to a numeric-format ('itl0') resource that specifies time formatting information for use in the conversion.
DESCRIPTION
LongTimeString converts the LongDateTime value in the dateTime parameter into a Pascal string representation of the time. You can use the LongSecondsToDate and LongDateToSeconds procedures, which are described in the book Inside Macintosh: Operating System Utilities, to convert between the LongDateRec (as produced by the StringToTime function) and LongDateTime data types.

LongTimeString produces a string that includes the seconds if you set the wantSeconds parameter to TRUE.

LongTimeString formats its data according to the information in the numeric-format resource specified in the intlParam parameter. If this value is NIL, LongTimeString uses the numeric-format resource from the current script. The numeric-format resource specifies whether or not to use leading zeros for the time values, whether to use a 12- or 24-hour time cycle, and how to specify morning or evening if a 12-hour time cycle
is used.

SPECIAL CONSIDERATIONS
LongTimeString may move memory; your application should not call this procedure at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the LongTimeString procedure are
Trap macroSelector
_Pack6$0016


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996