IUDatePString
IUDatePString
Convert seconds to date string specifiying formatting long rawSecs ; seconds since 1/1/1904 (ala GetDateTime) DateForm format ; 0=short form, 1=long form, 2=abbreviated
Str255 resultStr ; address of buffer to receive resulting p- string IUDatePString converts a binary date/time value into a string of text, exactly as described in IUDateString except that it provides a mechanism to override normal output formatting.
rawSecs is a long integer; the number of seconds since Midnight, 1/1/1904.
You can use any time value obtained from a file or catalog information
format specifies desired option in the output. It is one of the following
constants defined in Packages.h:
shortDate (0) Digits and separators: 10/1/1989
longDate (1) Text: Wednesday, February 1, 1989
abbrevDate (2) Abbreviated text: Wed, Feb 1, 1989
resultStr is the address of a buffer. Upon return, it will contain the text of
the date as a pascal-style length-prefixed string in the format
specified by format and in the language and layout identified by
'INTL' resource 1.
intlHndl is a Handle leading to either a 32-byte Intl0Rec structure or a 332-byte Intl1Rec structure. If format = shortDate, use an "international 0" handle obtained via IUGetIntl(0); otherwise, use
format the output of time and date strings.
Normal usage is to call IUGetIntl(n ), modify one or more fields of the example, below.
Example
#include <Packages.h>
/* following outputs 'long' date without the day; e.g.: January 4, 1989 */
long todayNum;
Intl0Hndl i0h; [TOKEN:12074] handle to an Intl0Rec */ Intl1Hndl i1h; [TOKEN:12074] handle to an Intl1Rec */ i1h = (Intl1Hndl)IUGetIntl( 1 ); /* get current settings, rsrc 1 */ (*i1h)->suppressDay=255; [TOKEN:12074] suppress the day part */ /* outputs 'short ' date with leading 0s and no century; e.g.: 01/04/89 */
i0h = (Intl0Hndl)IUGetIntl( 0 ); /* get current settings, rsrc 0 */ (*i0h)->shrtDateFmt |= dayLdingZ; /* use leading zeros */
(*i0h)->shrtDateFmt &= ~century; /* suppress century */