Documentation  |   Table of Contents   |  < Previous   |  Next >  

27    DateTime.h

Porting Applications to Palm OS® Cobalt

Exploring Palm OS®

The date/time APIs are largely unchanged in Palm OS Cobalt. The one real change is in the TimeZoneToAscii() function, where the way in which you specify the time zone has changed.

Deleted APIs ^TOP^

Table 27.1  Deleted macros

Deleted API

Use instead

TimeSeparator()

TimeGetFormatSeparator() function.

Use24HourFormat()

TimeIs24HourFormat() function.

Modified APIs ^TOP^

Table 27.2  Modified functions

Modified API

Description of change

void TimeZoneToAscii (const char *, char *)

Rather than specifying the time zone as some amount of minutes east of GMT and a locale, this function now takes one of the time zone ID strings found in the UI Library's TimeZoneSet.xrd file.

Table 27.3  Modified structures 

Modified API

Description of change

TimeType

The individual fields are now 8 bits of a uint16_t, rather than simply being declared as an unsigned 8-bit integer.

Table 27.4  Modified enumerated types

Modified API

Description of change

DateFormatType

Formerly an enum, this is now a typedef that takes a value defined by the DateFormatTag enum.

DaylightSavingsTypes

Formerly an enum, this is now a typedef that takes a value defined by the DaylightSavingsTag enum.

DayOfMonthType

Formerly an enum, this is now a typedef that takes a value defined by the DayOfWeekTag enum.

TimeFormatType

Formerly an enum, this is now a typedef that takes a value defined by the TimeFormatTag enum.

Table 27.5  Modified #defines

Modified API

Description of change

#define dateStringLength 15

Was 9.

#define dowDateStringLength 31

Was 19.

#define dowLongDateStrLength 47

Was 25.

#define longDateStrLength 31

Was 15.

#define timeStringLength 15

Was 9.

Unchanged APIs ^TOP^

Table 27.6  Unchanged functions 

DateAdjust()

DateDaysToDate()

DateSecondsToDate()

DateTemplateToAscii()

DateToAscii()

DateToDays()

DateToDOWDMFormat()

DayOfMonth()

DayOfWeek()

DaysInMonth()

TimAdjust()

TimDateTimeToSeconds()

TimeToAscii()

TimSecondsToDateTime()

TimTimeZoneToUTC()

TimUTCToTimeZone()

Table 27.7  Unchanged macros

DateToInt()

TimeToInt()

Table 27.8  Unchanged structures

DateTimeType

DateType

Table 27.9  Unchanged types

DatePtr

DateTimePtr

TimePtr

Table 27.10  Unchanged enumerated types

DateTemplatexxx values enum

Table 27.11  Unchanged #defines 

april

august

dateTemplateChar

dateTemplateLeadZeroModifier

dateTemplateLongModifier

dateTemplateRegularModifier

dateTemplateShortModifier

DayOfWeekType

daysInFourYears

daysInLeapYear

daysInSeconds

daysInWeek

daysInYear

december

february

firstYear

friday

hoursInMinutes

hoursInSeconds

hoursPerDay

january

july

june

lastYear

march

maxDays

maxSeconds

may

minutesInSeconds

monday

monthsInYear

noTime

november

numberOfYears

october

saturday

secondsInSeconds

september

sunday

thursday

timeZoneStringLength

tuesday

wednesday