How time is converted

TDateTimeFormatter uses the classes TTimeZone and TCalendar to provide the correct formatting for a particular locale. When a TDateTimeFormatter receives UTC time data, it goes through the following steps to convert it to a meaningful local time and date:

  1. Converts the TTime instance containing the UTC time to a TTime instance containing the local time, using the current TTimeZone.
  2. Maps the local time to a set of calendar fields (for example, month, date, and year) using the current TCalendar.
  3. Creates text output according to the requested pattern.

TDateTimeFormatter and TCalendar are abstract classes. Specific derived classes work together in pairs to provide the correct formatting for a particular calendaring system. The classes TGregorianDateTimeFormatter and TGregorianCalendar provide formatting for the Gregorian calendar used in many parts of the world. You can derive your own classes from TDateTimeFormatter and TCalendar to provide support for other calendaring systems. See "Creating a date and time formatter" on page 255 for more information.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker