Apple Newton Utilities Guide de l'utilisateur Page 743

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 942
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 742
CHAPTER 20
Localizing Newton Applications
Using the Localization Features of the Newton 20-11
Functions that Use the Locale Setting To Determine Format 20
These functions are quite simple. You pass in a system clock value or a string, and
the function uses the date and time format information in the current locale bundle
to produce a string or a system clock value. Here are the functions of this type:
DateNTime(time)
HourMinute(time)
ShortDate(time)
StringToDate(dateString)
StringToTime(timeString)
For example:
DateNTime(Time());
Depending on the locale, this might return the string:
"04/17/1996 10:53am"
See the Newton Programmer’s Reference for more information on these functions.
Functions that Take Format Specications 20
These functions take a time value and a string format specication and return a
string formatted accordingly:
LongDateStr(time, dateStrSpec)
ShortDateStr(time, dateStrSpec)
TimeStr(time, timeStrSpec)
You can pass three kinds of format specications:
You can use one of the pre-dened format specications in
ROM_dateTimeStrSpecs
You can use the GetDateStringSpec function to create a new format
specication
You can use the kIncludeAllElements constant, which tells the functions
to use the format in the active locale
In all cases, the active locale bundle determines certain features of date and time
strings, specically the order of elements and the separators used.
Using Formats from ROM_dateTimeStrSpecs 20
For commonly used format specications, the system denes formats that can be
passed directly to the functions that accept format specications. These formats are
stored in
ROM_dateTimeStrSpecs. See Table 17-5 (page 17-12) in Newton
Programmer’s Reference for the list of available formats.
Vue de la page 742
1 2 ... 738 739 740 741 742 743 744 745 746 747 748 ... 941 942

Commentaires sur ces manuels

Pas de commentaire