Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
The convert
command changes a value expressed as a valid date, time, or date and time format to another format.
You use and formatName
in combination with the first formatName
to convert a value to any two formats (often the date and time).
The form convert value to formatName
returns the converted value
in the local variable it
. The form convert [ph:container to formatName
converts a value in a chunk or container
(including variables) and places the result in that chunk or container.
You use the form from format
in situations where you don't want HyperCard to do the conversion automatically.
There are four types of date formats:
seconds
, a positive integer equal to the number of seconds since 12:00 midnight on January 1, 1904dateItems
, a comma-delimited list of seven positive integers equal to the following values: year
, month
, day
, hour
, minute
, second
, dayNumber
where dayNumber 1 = Sunday
and 7 = Saturday
.** [dayName,] monthName, day, year
** month/day/year
** month-day-year
where dayName
= Sunday
, Sun
, Monday
, Mon
, Tuesday
, Tue
, Wednesday
, Wed
, Thursday
, Thur
, Friday
, Fri
, Saturday
, or Sat
monthName
= January
, Jan
, February
, Feb
, March
, Mar
, April
, Apr
, May
, June
, Jun
, July
, Jul
, August
, Aug
, September
, Sep
, October
, Oct
, November
, Nov
, December
, or Dec
time
, which has the following format: hour:minute[:second] [timeOfDay]
where timeOfDay
= am
or pm
You can precede the format names date
and time
with an optional adjective, producing the following formats:
Note: HyperCard can handle dates from 1/1/1000 to 12/31/9999 in all formats. It handles dates from 1/1/1 to 12/31/9999 only in the dateItems
or seconds
format. If you try to convert an invalid date (such as "Friday, May 50, 1990"
), HyperCard sets the HyperTalk function the result
to "Invalid date."
When System 7.1 is running, HyperCard uses the date and time settings from the Date & Time Control Panel.
HyperTalk Definition
A place where you can store and retrieve a value.
There are six types of containers in HyperCard: a variable, a button, a field, the selection, the Message box, and menus.
Additionally, you can refer to a button or field by its part number:
AppleScript Definition
An object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of
or in
.
You can also use the possesive form ('s
) to specify containers. For example, in
the container is first window
. The object it contains is a name property.
One of the following names of a date or time format:
For example:
One of the following:
See also: formatName