[cl-l10n-cvs] CVS update: cl-l10n/doc/cl-l10n.texi

Sean Ross sross at common-lisp.net
Thu Mar 31 13:53:49 UTC 2005


Update of /project/cl-l10n/cvsroot/cl-l10n/doc
In directory common-lisp.net:/tmp/cvs-serv7026/doc

Modified Files:
	cl-l10n.texi 
Log Message:
Changelog 2005-03-31
Date: Thu Mar 31 15:53:47 2005
Author: sross

Index: cl-l10n/doc/cl-l10n.texi
diff -u cl-l10n/doc/cl-l10n.texi:1.6 cl-l10n/doc/cl-l10n.texi:1.7
--- cl-l10n/doc/cl-l10n.texi:1.6	Thu Mar 17 12:40:39 2005
+++ cl-l10n/doc/cl-l10n.texi	Thu Mar 31 15:53:47 2005
@@ -90,6 +90,7 @@
 @item CLISP
 @item Lispworks
 @item ECL
+ at item Allegro CL
 @end itemize
 
 
@@ -239,13 +240,13 @@
 @end deffn
 
 @anchor{Function print-time}
- at deffn {Function} print-time ut &key show-date show-time (stream *standard-output) (locale *locale) fmt
+ at deffn {Function} print-time ut &key show-date show-time (stream *standard-output) (locale *locale) fmt time-zone
 Prints the @code{universal-time} @emph{ut} as a locale specific time to @emph{stream}.
-Equivalent to @code{(format-time stream ut show-date show-time locale fmt)}.
+Equivalent to @code{(format-time stream ut show-date show-time locale fmt time-zone)}.
 @end deffn
 
 @anchor{Function format-time}
- at deffn {function} format-time stream ut show-date show-time &optional (locale *locale*) fmt
+ at deffn {function} format-time stream ut show-date show-time &optional (locale *locale*) fmt time-zone
 Prints the @code{universal-time} @emph{ut} as a locale specific time to @emph{stream}.
 The format of the time printed is controlled by @emph{show-time} and @emph{show-date}.
 
@@ -262,10 +263,10 @@
 @end table
 
 If @emph{fmt} is not nil then @emph{show-date} and @emph{show-time} are ignored 
-and @emph{fmt} is used as the format control string. For details of format
-directive look at 'man 1 date' although some directives are not supported, namely %U, %V and %W.
+and @emph{fmt} is used as the format control string. See the Notes Section for 
+the defined control characters which can be used.
 
-Examples (assuming *locale* is ``en_ZA'')
+Examples (assuming *locale* is ``en_ZA'' and a CL -2 Time Zone)
 @verbatim
 (format t "~:/cl-l10n:format-time/" 3192624000)
   prints `03/03/01'
@@ -281,6 +282,11 @@
 
 (format t "~,v/cl-l10n:format-time/" "%A" 3192624000)
   prints `Saturday'
+
+; The Time Zone can be overriden with an extra v argument
+(format t "~v,v,v/cl-l10n:format-time/" "en_ZA" "%A" -8 3192624000)
+  print `Sunday'
+
 @end verbatim
 @end deffn
 
@@ -297,7 +303,7 @@
 drop in replacements for the ~/cl-l10n:format-?/ calls.
 
 @verbatim
-;; These examples assume an en_ZA locale
+;; These examples assume an en_ZA locale and a CL -2 Time Zone
 (in-package :cl-user)
 
 (shadowing-import 'cl-l10n::format)
@@ -330,6 +336,30 @@
 Parses the string @emph{num-string} into a number using @emph{locale}. 
 @end deffn
 
+ at anchor{Function parse-time}
+ at deffn {Function} parse-time time-string &key (start 0) (end (length time-string)) (error-on-mismatch nil) (patterns *default-date-time-patterns*) (default-seconds nil) (default-minutes nil) (default-hours nil) (default-day nil) (default-month nil) (default-year nil) (default-zone nil) (default-weekday nil) (locale *locale*)
+
+Tries very hard to make sense out of the argument time-string using
+locale and returns a single integer representing the universal time if
+successful.  If not, it returns nil.  If the :error-on-mismatch
+keyword is true, parse-time will signal an error instead of
+returning nil.  Default values for each part of the time/date
+can be specified by the appropriate :default- keyword.  These
+keywords can be given a numeric value or the keyword :current
+to set them to the current value.  The default-default values
+are 00:00:00 on the current date, current time-zone.
+
+Example, what date does the string ``02/03/05'' specify?
+parse-time will use the current locale or the locale-designator
+passed to it to determine the correct format for dates.
+In America (en_US) this date is the 3rd of February 2005, with an South African English (en_ZA)
+locale this date is the 2nd of March 2005 and with a Swedish locale (sv_SE) it's the 5th of March 2002.
+
+Note. This is not my work but was done by Jim Healy and is a part of the CMUCL project, 
+      which has been modified to handle differt locales.
+
+ at end deffn
+
 
 @section Classes
 @anchor{Class locale}
@@ -348,12 +378,20 @@
 @section Conditions
 @anchor{Condition locale-error}
 @deftp {Condition} locale-error
-Class Precedence: @code{condition}
+Class Precedence: @code{error}
 
 Root CL-L10N condition which will be signalled when an exceptional 
 situation occurs.
 @end deftp
 
+ at anchor{Condition parser-error}
+ at deftp {Condition} parser-error
+Class Precedence: @code{error}
+Error which is signalled when an error occurs when parsing numbers
+or time strings.
+ at end deftp
+
+
 @node I18N
 @chapter I18N
 
@@ -482,17 +520,108 @@
 is loaded. If these two have failed then the POSIX locale is loaded 
 as the default.
 
+ at section Time Format Control Characters
+The following is a list of each legal control character in a time 
+format string followed by a description of what is does.
+ at itemize
+ at item %%        A percentage sign.
+ at item %a        locale's abbreviated weekday name (Sun..Sat)
+ at item %A        locale's full weekday name, variable length (Sunday..Saturday)
+ at item %b        locale's abbreviated month name (Jan..Dec)
+ at item %B        locale's full month name, variable length (January..December)
+ at item %c        locale's date and time (Sat Nov 04 12:02:33 EST 1989)
+ at item %C        century [00-99]
+ at item %d        day of month (01..31)
+ at item %D        date (mm/dd/yy)
+ at item %e        day of month, blank padded ( 1..31)
+ at item %F        same as %Y-%m-%d
+ at item %g        the 2-digit year corresponding to the %V week number
+ at item %G        the 4-digit year corresponding to the %V week number
+ at item %h        same as %b
+ at item %H        hour (00..23)
+ at item %I        hour (01..12)
+ at item %j        day of year (001..366)
+ at item %k        hour ( 0..23)
+ at item %l        hour ( 1..12)
+ at item %m        month (01..12)
+ at item %M        minute (00..59)
+ at item %n        a newline
+ at item %N        nanoseconds (Always 000000000)
+ at item %p        locale's upper case AM or PM indicator (blank in many locales)
+ at item %P        locale's lower case am or pm indicator (blank in many locales)
+ at item %r        time, 12-hour (hh:mm:ss [AP]M)
+ at item %R        time, 24-hour (hh:mm)
+ at item %s        seconds since `00:00:00 1970-01-01 UTC'
+ at item %S        second (00..60)
+ at item %t        a horizontal tab
+ at item %T        time, 24-hour (hh:mm:ss)
+ at item %u        day of week (1..7);  1 represents Monday
+ at item %U        week number of year with Sunday as first day of week (00..53)
+ at item %V        week number of year with Monday as first day of week (01..53)
+ at item %w        day of week (0..6);  0 represents Sunday
+ at item %W        week number of year with Monday as first day of week (00..53)
+ at item %x        locale's date representation (locale-d-fmt)
+ at item %X        locale's time representation (locale-t-fmt)
+ at item %y        last two digits of year (00..99)
+ at item %Y        year (1900...)
+ at item %z        RFC-2822  style  numeric  timezone (-0500)
+ at item %Z        RFC-2822  style  numeric  timezone (-0500)
+ at end itemize
+
 @section Accessors to Locale Values.
 There are a number of accessor functions to the various locale 
 attributes defined. The functions are named by replacing 
-underscores with hypens and prepending locale- to the name
-For example the attribute int_frac_digits 
-can be accessed by the function @code{locale-int-frac-digits}.
+underscores with hypens and prepending locale- to the name.
+The following is each defined accessor function in the format 
+Category, Keyword and the accessor function for it.
+ at itemize 
+ at item LC_MONETARY    int_curr_symbol      @code{locale-int-curr-symbol}
+ at item LC_MONETARY    currency_symbol      @code{locale-currency-symbol}
+ at item LC_MONETARY    mon_decimal_point    @code{locale-mon-decimal-point}
+ at item LC_MONETARY    mon_thousands_sep    @code{locale-mon-thousands-sep}
+ at item LC_MONETARY    mon_grouping         @code{locale-mon-grouping}
+ at item LC_MONETARY    positive_sign        @code{locale-positive-sign}
+ at item LC_MONETARY    negative_sign        @code{locale-negative-sign}
+ at item LC_MONETARY    int_frac_digits      @code{locale-int-frac-digits }
+ at item LC_MONETARY    frac_digits          @code{locale-frac-digits }
+ at item LC_MONETARY    p_cs_precedes        @code{locale-p-cs-precedes }
+ at item LC_MONETARY    p_sep_by_space       @code{locale-p-sep-by-space }
+ at item LC_MONETARY    n_cs_precedes        @code{locale-n-cs-precedes }
+ at item LC_MONETARY    n_sep_by_space       @code{locale-n-sep-by-space }
+ at item LC_MONETARY    p_sign_posn          @code{locale-p-sign-posn }
+ at item LC_MONETARY    n_sign_posn          @code{locale-n-sign-posn }
+ at item LC_NUMERIC     decimal_point        @code{locale-decimal-point}
+ at item LC_NUMERIC     thousands_sep        @code{locale-thousands-sep}
+ at item LC_NUMERIC     grouping             @code{locale-grouping }
+ at item LC_TIME        abday                @code{locale-abday}
+ at item LC_TIME        day                  @code{locale-day}
+ at item LC_TIME        abmon                @code{locale-abmon}
+ at item LC_TIME        mon                  @code{locale-mon}
+ at item LC_TIME        d_t_fmt              @code{locale-d-t-fmt}
+ at item LC_TIME        d_fmt                @code{locale-d-fmt}
+ at item LC_TIME        t_fmt                @code{locale-t-fmt}
+ at item LC_TIME        am_pm                @code{locale-am-pm}
+ at item LC_TIME        t_fmt_ampm           @code{locale-t-fmt-ampm}
+ at item LC_TIME        date_fmt             @code{locale-date-fmt}
+ at item LC_MESSAGES    yesexpr              @code{locale-yesexpr}
+ at item LC_MESSAGES    noexpr               @code{locale-noexpr}
+ at item LC_PAPER       height               @code{locale-height}
+ at item LC_PAPER       width                @code{locale-width}
+ at item LC_NAME        name_fmt             @code{locale-name-fmt}
+ at item LC_NAME        name_gen             @code{locale-name-gen}
+ at item LC_NAME        name_mr              @code{locale-name-mr}
+ at item LC_NAME        name_mrs             @code{locale-name-mrs}
+ at item LC_NAME        name_miss            @code{locale-name-miss}
+ at item LC_NAME        name_ms              @code{locale-name-ms}
+ at item LC_ADDRESS     postal_fmt           @code{locale-postal-fmt}
+ at item LC_TELEPHONE   tel_int_fmt          @code{locale-tel-int-fmt}
+ at item LC_MEASUREMENT measurement          @code{locale-measurement}
+ at end itemize
 
 @section Known Issues
 @itemize @bullet
 @item  LC_COLLATE and LC_CTYPE categories in the locale files are currently ignored.
- at item  Not all time format directives are supported.
+ at item  Not all time format directives are supported (U, V and W are not implemented). 
 @end itemize
 
 




More information about the Cl-l10n-cvs mailing list