Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 4 - Date, Time, and Measurement Utilities / Date, Time, and Measurement Utilities Reference
Data Structures


The Geographic Location Record

The geographic location and time-zone information of a Macintosh computer are stored in extended parameter RAM. The MachineLocation data type defines the format for the geographic location record.

TYPE MachineLocation =  {geographic location record}
RECORD
   latitude:            Fract;         {latitude}
   longitude:           Fract;         {longitude}
   CASE Integer OF
   0:
      (dlsDelta:        SignedByte);   {daylight saving time}
   1:
      (gmtDelta:        LongInt);      {Greenwich mean time}
END;
Field Description
latitude
The location's latitude, in fractions of a great circle. For example, Copenhagen, Denmark is at 55.43 degrees north latitude. When writing the latitude to extended parameter RAM with the WriteLocation procedure, you must convert this value to a Fract data type. (For example, a Fract value of 1.0 equals 90 degrees; -1.0 equals -90 degrees; and -2.0 equals -180 degrees.) For an example that shows this conversion process, see Listing 4-8 on page 4-19. For more information on the Fract data type, see the chapter "Mathematical and Logical Utilities" in this book.
longitude
The location's longitude, in fractions of a great circle. For example, Copenhagen, Denmark is at 12.34 degrees east longitude. When writing the longitude to extended parameter RAM with the WriteLocation procedure, you must convert this value to a Fract data type. (For example, a Fract value of 1.0 equals 90 degrees; -1.0 equals -90 degrees; and -2.0 equals -180 degrees.) For an example that shows this conversion process, see Listing 4-8 on page 4-19. For more information on the Fract data type, see the chapter "Mathematical and Logical Utilities" in this book.
dlsDelta
A signed byte value representing the hour offset for daylight saving time. This field is a 1-byte value contained in a long word. It should be preserved when writing gmtDelta. See Listing 4-10 on page 4-21 for an example that writes gmtDelta while preserving dlsDelta.
gmtDelta
The Greenwich mean time (GMT). For example, Copenhagen, Denmark is at 1 hour west of GMT. This field is a 3-byte value contained in a long word. In addition, the top byte of this field should be masked off when writing because it is reserved. See Listing 4-9 on page 4-20 and Listing 4-10 on page 4-21 for code examples that get and set gmtDelta properly.
The ReadLocation and WriteLocation procedures use the geographic location record to read and store the geographic location and time zone information in extended parameter RAM. If the geographic location record has never been set, all fields contain 0.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice