diff --git a/reference/intl/dateformatter-constants.xml b/reference/intl/dateformatter-constants.xml index 3a3808a448..87b4c3a3be 100644 --- a/reference/intl/dateformatter-constants.xml +++ b/reference/intl/dateformatter-constants.xml @@ -1,10 +1,11 @@ - +
&reftitle.constants; -TODO + These constants are used to specify different formats + in the constructor for DateType and TimeType. @@ -12,7 +13,7 @@ TODO (string) - TODO + Do not include this element @@ -21,7 +22,7 @@ TODO (string) - TODO + Completely specified style (Tuesday, April 12, 1952 AD or 3:30:42pm PST) @@ -30,7 +31,7 @@ TODO (string) - TODO + Long style (January 12, 1952 or 3:30:32pm) @@ -39,7 +40,7 @@ TODO (string) - TODO + Medium style (Jan 12, 1952) @@ -48,16 +49,27 @@ TODO (string) - TODO + Most abbreviated style, only essential data (12/13/52 or 3:30pm) + + +
+ +
+ + The following int constants are used to specify the calendar. + These calendars are all based directly on the Gregorian calendar. + Non-Gregorian calendars need to be specified in locale. + Examples might include locale="hi@calendar=BUDDHIST". + DateFormatter::TRADITIONAL (string) - TODO + Non-Gregorian Calendar @@ -66,12 +78,12 @@ TODO (string) - TODO + Gregorian Calendar -
+ + The DateFormatter class DateFormatter @@ -9,9 +9,16 @@
&reftitle.intro; - - TODO - + + Date Formatter is a concrete class that enables locale-dependent formatting/parsing + of dates using pattern strings and/or canned patterns. + + + + This class represents the ICU date formatting functionality. + It allows users to display dates in a localized format or to parse strings + into PHP date values using pattern strings and/or canned patterns. +
@@ -34,6 +41,17 @@ +
+ &reftitle.seealso; + + + + ICU Date formatter + + + +
+ &reference.intl.dateformatter-constants; @@ -60,4 +78,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/reference/intl/dateformatter/create.xml b/reference/intl/dateformatter/create.xml index cd0487da8b..b29b197c5f 100644 --- a/reference/intl/dateformatter/create.xml +++ b/reference/intl/dateformatter/create.xml @@ -1,5 +1,5 @@ - + DateFormatter::create @@ -21,7 +21,7 @@ Object oriented style (constructor) - DateFormatter + DateFormatter::__construct __construct stringlocale @@ -44,7 +44,7 @@ Create a date formatter -GREGORIAN + @@ -55,35 +55,45 @@ GREGORIAN locale - Locale to use when formatting or parsing + Locale to use when formatting or parsing + datetype - Date type to use (none, short, medium, long, full) + Date type to use (none, short, medium, long, full). + This is one of the + DateFormatter constants. + timetype - Time type to use (none, short, medium, long, full) + Time type to use (none, short, medium, long, full). + This is one of the + DateFormatter constants. + timezone - Time zone ID ; default is system default + Time zone ID, default is system default. calendar - Calendar to use for formatting or parsing; default is + Calendar to use for formatting or parsing; default is Gregorian. + This is one of the + DateFormatter calendar constants. + @@ -110,8 +120,16 @@ GREGORIAN <function>datefmt_create</function> example ]]> @@ -120,8 +138,16 @@ TODO OO example format(0); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ); +echo "Second Formatted output is ".$fmt->format(0); + +$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy"); +echo "First Formatted output with pattern is ".$fmt->format(0); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN , "MM/dd/yyyy"); +echo "Second Formatted output with pattern is ".$fmt->format(0); ?> ]]> @@ -129,15 +155,23 @@ TODO &example.outputs; +First Formatted output is Wednesday, December 31, 1969 4:00:00 PM PT +Second Formatted output is Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00 +First Formatted output with pattern is 12/31/1969 +Second Formatted output with pattern is 12/31/1969 + ]]> &reftitle.seealso; -TODO + + datefmt_format + datefmt_parse + datefmt_get_error_code + datefmt_get_error_message + diff --git a/reference/intl/dateformatter/format.xml b/reference/intl/dateformatter/format.xml index 3c85805c3b..8387440ea2 100644 --- a/reference/intl/dateformatter/format.xml +++ b/reference/intl/dateformatter/format.xml @@ -1,10 +1,10 @@ - + DateFormatter::format datefmt_format - formats the time value as a string. + Format the date/time value as a string &reftitle.description; @@ -13,19 +13,18 @@ DateFormatter stringformat - mixedvalue + mixedvalue Procedural style stringdatefmt_format DateFormatterfmt - mixedvalue + mixedvalue - formats the time value as a string. -integer: a unix timestamp value (seconds since epoch, UTC) -array: a localtime array + Formats the time value as a string. + @@ -43,7 +42,9 @@ array: a localtime array value - - value to format + Value to format. Can be integer for an Unix timestamp value (seconds since epoch, UTC) or + array for a localtime array. + @@ -54,7 +55,7 @@ array: a localtime array &reftitle.returnvalues; - a formatted string or, if an error occurred, 'null'. + The formatted string or, if an error occurred, &false;. @@ -63,8 +64,17 @@ array: a localtime array <function>datefmt_format</function> example ]]> @@ -73,8 +83,16 @@ TODO OO example format(0); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ); +echo "Second Formatted output is ".$fmt->format(0); + +$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ,"MM/dd/yyyy"); +echo "First Formatted output with pattern is ".$fmt->format(0); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN , "MM/dd/yyyy"); +echo "Second Formatted output with pattern is ".$fmt->format(0); ?> ]]> @@ -82,7 +100,10 @@ TODO &example.outputs; @@ -90,7 +111,12 @@ TODO &reftitle.seealso; -TODO + + datefmt_create + datefmt_parse + datefmt_get_error_code + datefmt_get_error_message + diff --git a/reference/intl/dateformatter/get-calendar.xml b/reference/intl/dateformatter/get-calendar.xml index 1674bfc367..7dba530781 100644 --- a/reference/intl/dateformatter/get-calendar.xml +++ b/reference/intl/dateformatter/get-calendar.xml @@ -1,5 +1,5 @@ - + DateFormatter::getCalendar @@ -44,7 +44,7 @@ &reftitle.returnvalues; - the calendar being used by the formatter + The calendar being used by the formatter. @@ -53,8 +53,11 @@ <function>datefmt_get_calendar</function> example ]]> @@ -63,8 +66,12 @@ TODO OO example getCalendar(); +$fmt->setCalendar(DateFormatter::TRADITIONAL); +echo "Now calendar of the formatter is : ".$fmt->getCalendar(); + ?> ]]> @@ -72,7 +79,8 @@ TODO &example.outputs; @@ -80,7 +88,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_set_calendar + datefmt_create + diff --git a/reference/intl/dateformatter/get-datetype.xml b/reference/intl/dateformatter/get-datetype.xml index 8cb8c72a71..05312da851 100644 --- a/reference/intl/dateformatter/get-datetype.xml +++ b/reference/intl/dateformatter/get-datetype.xml @@ -1,5 +1,5 @@ - + DateFormatter::getDateType @@ -22,6 +22,7 @@ DateFormatterfmt + Returns date type used by the formatter. @@ -33,7 +34,7 @@ fmt - The formatter resource + The formatter resource. @@ -44,7 +45,8 @@ &reftitle.returnvalues; - the current 'datetype' value of the formatter + The current date type value of the formatter. + @@ -53,8 +55,14 @@ <function>datefmt_get_datetype</function> example ]]> @@ -63,8 +71,14 @@ TODO OO example getDateType(); +echo "First Formatted output is ".datefmt_format( $fmt , 0); +$fmt = new DateFormatter( "en_US" ,DateFormatter::SHORT,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN); +echo "Now datetype of the formatter is : ".$fmt->getDateType(); +echo "Second Formatted output is ".datefmt_format( $fmt , 0); + ?> ]]> @@ -72,7 +86,10 @@ TODO &example.outputs; @@ -80,7 +97,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_timetype + datefmt_create + diff --git a/reference/intl/dateformatter/get-error-code.xml b/reference/intl/dateformatter/get-error-code.xml index 3630abf55f..88903b5e51 100644 --- a/reference/intl/dateformatter/get-error-code.xml +++ b/reference/intl/dateformatter/get-error-code.xml @@ -1,5 +1,5 @@ - + DateFormatter::getErrorCode @@ -34,7 +34,7 @@ Returns error code from the last number formatting operation. fmt - The formatter resource + The formatter resource. @@ -54,8 +54,12 @@ Returns error code from the last number formatting operation. <function>datefmt_get_error_code</function> example ]]> @@ -64,8 +68,12 @@ TODO OO example format(); +if(!$str) { + echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; +} ?> ]]> @@ -73,7 +81,7 @@ TODO &example.outputs; @@ -81,7 +89,11 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_error_message + intl_get_error_code + intl_is_failure + diff --git a/reference/intl/dateformatter/get-error-message.xml b/reference/intl/dateformatter/get-error-message.xml index 00e05307af..8a81183953 100644 --- a/reference/intl/dateformatter/get-error-message.xml +++ b/reference/intl/dateformatter/get-error-message.xml @@ -1,5 +1,5 @@ - + DateFormatter::getErrorMessage @@ -33,7 +33,7 @@ fmt - The formatter resource + The formatter resource. @@ -53,8 +53,12 @@ <function>datefmt_get_error_message</function> example ]]> @@ -63,8 +67,13 @@ TODO OO example format(); +if(!$str) { + echo "ERROR: ".$fmt->getErrorMessage() . " (" . $fmt->getErrorCode() . ")\n"; +} + ?> ]]> @@ -72,7 +81,7 @@ TODO &example.outputs; @@ -80,7 +89,11 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_error_code + intl_get_error_code + intl_is_failure + diff --git a/reference/intl/dateformatter/get-locale.xml b/reference/intl/dateformatter/get-locale.xml index aa92ab9a5d..8c7674d0b1 100644 --- a/reference/intl/dateformatter/get-locale.xml +++ b/reference/intl/dateformatter/get-locale.xml @@ -1,10 +1,10 @@ - + DateFormatter::getLocale datefmt_get_locale - values may include ULOC_ACTUAL_LOCALE, + Get the locale used by formatter &reftitle.description; @@ -13,19 +13,18 @@ DateFormatter stringgetLocale - integerhich + integerwhich Procedural style stringdatefmt_get_locale DateFormatterfmt - integerhich + integerwhich - values may include ULOC_ACTUAL_LOCALE, -ULOC_VALID_LOCALE. By default the actual -locale is returned. + Get locale used by the formatter. + @@ -43,7 +42,11 @@ locale is returned. hich - locale should be returned? + You can choose between valid and actual locale ( + Locale::VALID_LOCALE, + Locale::ACTUAL_LOCALE, + respectively). The default is the actual locale. + @@ -63,8 +66,14 @@ locale is returned. <function>datefmt_get_locale</function> example ]]> @@ -73,8 +82,14 @@ TODO OO example getLocale(); +echo "First Formatted output is ".$fmt->format(0); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ); +echo "locale of the formatter is : ".$fmt->getLocale(); +echo "Second Formatted output is ".$fmt->format(0); + ?> ]]> @@ -82,7 +97,10 @@ TODO &example.outputs; @@ -90,7 +108,9 @@ TODO &reftitle.seealso; -TODO + + datefmt_create + diff --git a/reference/intl/dateformatter/get-pattern.xml b/reference/intl/dateformatter/get-pattern.xml index fb0b0cb6b9..3a04d15cb0 100644 --- a/reference/intl/dateformatter/get-pattern.xml +++ b/reference/intl/dateformatter/get-pattern.xml @@ -1,5 +1,5 @@ - + DateFormatter::getPattern @@ -22,7 +22,8 @@ DateFormatterfmt - + Get pattern used by the formatter. + @@ -33,7 +34,7 @@ fmt - The formatter resource + The formatter resource. @@ -44,7 +45,7 @@ &reftitle.returnvalues; - the pattern string being used to format/parse + the pattern string being used to format/parse. @@ -53,8 +54,14 @@ <function>datefmt_get_pattern</function> example ]]> @@ -63,8 +70,13 @@ TODO OO example getPattern(); +echo "First Formatted output is ".datefmt_format( $fmt , 0); +$fmt->setPattern('yyyymmdd hh:mm:ss z'); +echo "Now pattern of the formatter is : ".$fmt->getPattern(); +echo "Second Formatted output is ".datefmt_format( $fmt , 0); ?> ]]> @@ -72,7 +84,10 @@ TODO &example.outputs; @@ -80,7 +95,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_set_pattern + datefmt_create + diff --git a/reference/intl/dateformatter/get-timetype.xml b/reference/intl/dateformatter/get-timetype.xml index 4c492fd135..72ce7c032d 100644 --- a/reference/intl/dateformatter/get-timetype.xml +++ b/reference/intl/dateformatter/get-timetype.xml @@ -1,5 +1,5 @@ - + DateFormatter::getTimeType @@ -22,6 +22,7 @@ DateFormatterfmt + Return time type used by the formatter. @@ -33,7 +34,7 @@ fmt - The formatter resource + The formatter resource. @@ -44,7 +45,8 @@ &reftitle.returnvalues; - the current 'timetype' value of the formatter + The current date type value of the formatter. + @@ -53,8 +55,14 @@ <function>datefmt_get_timetype</function> example ]]> @@ -63,8 +71,14 @@ TODO OO example getTimeType(); +echo "First Formatted output is ".datefmt_format( $fmt , 0); +$fmt = new DateFormatter( "en_US" ,DateFormatter::FULL,DateFormatter::SHORT,'America/Los_Angeles',DateFormatter::GREGORIAN); +echo "Now timetype of the formatter is : ".$fmt->getTimeType(); +echo "Second Formatted output is ".datefmt_format( $fmt , 0); + ?> ]]> @@ -72,7 +86,10 @@ TODO &example.outputs; @@ -80,7 +97,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_datetype + datefmt_create + diff --git a/reference/intl/dateformatter/get-timezone-id.xml b/reference/intl/dateformatter/get-timezone-id.xml index 8efd3b28ba..13e51d47cd 100644 --- a/reference/intl/dateformatter/get-timezone-id.xml +++ b/reference/intl/dateformatter/get-timezone-id.xml @@ -1,5 +1,5 @@ - + DateFormatter::getTimeZoneId @@ -33,7 +33,7 @@ fmt - The formatter resource + The formatter resource. @@ -44,7 +44,7 @@ &reftitle.returnvalues; - ID string for the time zone used by this formatter + ID string for the time zone used by this formatter. @@ -53,8 +53,12 @@ <function>datefmt_get_timezone_id</function> example ]]> @@ -63,8 +67,12 @@ TODO OO example getTimezoneId(); +$fmt->setTimezoneId('CN'); +echo "Now timezone_id of the formatter is : ".$fmt->getTimezoneId(); + ?> ]]> @@ -72,7 +80,8 @@ TODO &example.outputs; @@ -80,7 +89,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_set_timezone_id + datefmt_create + diff --git a/reference/intl/dateformatter/is-lenient.xml b/reference/intl/dateformatter/is-lenient.xml index fea89aff17..baa5b37517 100644 --- a/reference/intl/dateformatter/is-lenient.xml +++ b/reference/intl/dateformatter/is-lenient.xml @@ -1,5 +1,5 @@ - + DateFormatter::isLenient @@ -22,7 +22,8 @@ DateFormatterfmt - + Check if the parser is strict or lenient in interpretting inputs that do not match the pattern exactly. + @@ -44,7 +45,8 @@ &reftitle.returnvalues; - 'true' if parser is lenient, 'false' if parser is strictdefault value for parser is 'false'. + &true; if parser is lenient, &false; if parser is strict. By default the parser is strict. + @@ -53,8 +55,22 @@ <function>datefmt_is_lenient</function> example isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} +datefmt_set_lenient($fmt,false); +echo "Now lenient of the formatter is : "; +if( $fmt->isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} + ?> ]]> @@ -63,8 +79,22 @@ TODO OO example isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} +$fmt->setLenient(FALSE); +echo "Now lenient of the formatter is : "; +if( $fmt->isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} + ?> ]]> @@ -72,7 +102,8 @@ TODO &example.outputs; @@ -80,7 +111,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_set_lenient + datefmt_create + diff --git a/reference/intl/dateformatter/localtime.xml b/reference/intl/dateformatter/localtime.xml index 13d535814a..e136cfb6ce 100644 --- a/reference/intl/dateformatter/localtime.xml +++ b/reference/intl/dateformatter/localtime.xml @@ -1,10 +1,10 @@ - + DateFormatter::localtime datefmt_localtime - converts string $value to a field-based time value, starting at + Parse string to a field-based time value &reftitle.description; @@ -96,8 +96,17 @@ If $parse_pos > strlen($value), the parse fails immediately. <function>datefmt_localtime</function> example $value) { + echo "$key : $value , "; + } +} + ?> ]]> @@ -106,8 +115,16 @@ TODO OO example localtime( "Wednesday, December 31, 1969 4:00:00 PM PT",0,0); +echo "First parsed output is "; +if ($arr) { + foreach ($arr as $key => $value) { + echo "$key : $value , "; + } +} + ?> ]]> @@ -115,7 +132,8 @@ TODO &example.outputs; @@ -123,7 +141,13 @@ TODO &reftitle.seealso; -TODO + + datefmt_create + datefmt_format + datefmt_parse + datefmt_get_error_code + datefmt_get_error_message + diff --git a/reference/intl/dateformatter/parse-to-localtime.xml b/reference/intl/dateformatter/parse-to-localtime.xml deleted file mode 100644 index 0b96d1777a..0000000000 --- a/reference/intl/dateformatter/parse-to-localtime.xml +++ /dev/null @@ -1,115 +0,0 @@ - - - - - DateFormatter::parseToLocaltime - datefmt_parse_to_localtime - Field-based equivalent of parse(). - - - &reftitle.description; - Object oriented style - - DateFormatter - - arrayparseToLocaltime - stringvalue - - - Procedural style - - arraydatefmt_parse_to_localtime - DateFormatterfmt - stringvalue - - - Field-based equivalent of parse(). - - - - &reftitle.parameters; - - - - fmt - - - The formatter resource - - - - value - - - String value to parse into a date. - - - - - - - - - &reftitle.returnvalues; - - An array in the same format as localtime produces - - - - &reftitle.examples; - - <function>datefmt_parse_to_localtime</function> example - - -]]> - - - - OO example - - -]]> - - - &example.outputs; - - - - - - - &reftitle.seealso; - -TODO - - - - - diff --git a/reference/intl/dateformatter/parse-to-timestamp.xml b/reference/intl/dateformatter/parse-to-timestamp.xml deleted file mode 100644 index 0c9f0db0d3..0000000000 --- a/reference/intl/dateformatter/parse-to-timestamp.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - DateFormatter::parseToTimestamp - datefmt_parse_to_timestamp - converts the string $value to a Unix timestamp (a time_t integer - - - &reftitle.description; - Object oriented style - - DateFormatter - - integerparseToTimestamp - stringvalue - - - Procedural style - - integerdatefmt_parse_to_timestamp - DateFormatterfmt - stringvalue - - - converts the string $value to a Unix timestamp (a time_t integer -value, seconds since epoch). - - - - &reftitle.parameters; - - - - fmt - - - The formatter resource - - - - value - - - string to convert to a time - - - - - - - - - &reftitle.returnvalues; - - timestamp value - - - - &reftitle.examples; - - <function>datefmt_parse_to_timestamp</function> example - - -]]> - - - - OO example - - -]]> - - - &example.outputs; - - - - - - - &reftitle.seealso; - -TODO - - - - - diff --git a/reference/intl/dateformatter/parse.xml b/reference/intl/dateformatter/parse.xml index 91651487f1..a587044d88 100644 --- a/reference/intl/dateformatter/parse.xml +++ b/reference/intl/dateformatter/parse.xml @@ -1,10 +1,10 @@ - + DateFormatter::parse datefmt_parse - converts string $value to an incremental time value, starting at + Parse string to a timestamp value &reftitle.description; @@ -86,8 +86,11 @@ If $parse_pos > strlen($value), the parse fails immediately. <function>datefmt_parse</function> example parse("Wednesday, December 31, 1969 4:00:00 PM PT"); +$fmt = new DateFormatter( "de-DE" ,DateFormatter::FULL,DateFormatter::FULL,'America/Los_Angeles',DateFormatter::GREGORIAN ); +echo "Second parsed output is ".$fmt->parse("Mittwoch, 31. Dezember 1969 16:00 Uhr GMT-08:00"); ?> ]]> @@ -96,8 +99,11 @@ TODO OO example ]]> @@ -105,7 +111,8 @@ TODO &example.outputs; @@ -113,7 +120,13 @@ TODO &reftitle.seealso; -TODO + + datefmt_create + datefmt_format + datefmt_localtime + datefmt_get_error_code + datefmt_get_error_message + diff --git a/reference/intl/dateformatter/set-calendar.xml b/reference/intl/dateformatter/set-calendar.xml index 6e0708e443..c5d800aa99 100644 --- a/reference/intl/dateformatter/set-calendar.xml +++ b/reference/intl/dateformatter/set-calendar.xml @@ -1,5 +1,5 @@ - + DateFormatter::setCalendar @@ -23,11 +23,8 @@ integerwhich - sets the calendar used to the appropriate calendar, which must be -one of the constants defined above. Some examples include: -- Gregorian calendar -- Traditional -Default value is GREGORIAN + Sets the calendar used by the formatter. + @@ -38,14 +35,17 @@ Default value is GREGORIAN fmt - The formatter resource + The formatter resource. + which - the calendar (an enumerated constant) to use. + The calendar to use. + Default is DateFormatter::GREGORIAN. + @@ -56,7 +56,8 @@ Default value is GREGORIAN &reftitle.returnvalues; - 'true' if successful, 'false' if an error occurred or if the calendar was not recognized + &return.success; + @@ -65,8 +66,11 @@ Default value is GREGORIAN <function>datefmt_set_calendar</function> example ]]> @@ -75,8 +79,11 @@ TODO OO example getCalendar(); +$fmt->setCalendar(DateFormatter::TRADITIONAL); +echo "Now calendar of the formatter is : ".$fmt->getCalendar(); ?> ]]> @@ -84,7 +91,8 @@ TODO &example.outputs; @@ -92,7 +100,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_calendar + datefmt_create + diff --git a/reference/intl/dateformatter/set-lenient.xml b/reference/intl/dateformatter/set-lenient.xml index e753c63229..fa6c4fd72b 100644 --- a/reference/intl/dateformatter/set-lenient.xml +++ b/reference/intl/dateformatter/set-lenient.xml @@ -1,10 +1,10 @@ - + DateFormatter::setLenient datefmt_set_lenient - 'true' sets the parser to accept otherwise flawed date or + Set the leniency of the parser &reftitle.description; @@ -23,11 +23,11 @@ booleanlenient - 'true' sets the parser to accept otherwise flawed date or -time patterns, parsing as much as possible to obtain a value. -'false' sets the parser to strictly parse strings into dates. -Extra space, unrecognized tokens, or invalid values -("Feburary 30th") are not accepted. + Define if the parser is strict or lenient in interpretting inputs that do not match the pattern exactly. + Enabling lenient parsing allows the parser to accept otherwise flawed date or + time patterns, parsing as much as possible to obtain a value. + Extra space, unrecognized tokens, or invalid values ("Feburary 30th") are not accepted. + @@ -45,7 +45,8 @@ Extra space, unrecognized tokens, or invalid values lenient - sets whether the parser is lenient or not, default is 'false' + Sets whether the parser is lenient or not, default is &false; (strict). + @@ -56,7 +57,8 @@ Extra space, unrecognized tokens, or invalid values &reftitle.returnvalues; - 'true' if successful; 'false' if an error occurred. + &return.success; + @@ -65,8 +67,22 @@ Extra space, unrecognized tokens, or invalid values <function>datefmt_set_lenient</function> example isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} +datefmt_set_lenient($fmt,false); +echo "Now lenient of the formatter is : "; +if( $fmt->isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} + ?> ]]> @@ -75,8 +91,21 @@ TODO OO example isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} +$fmt->setLenient(FALSE); +echo "Now lenient of the formatter is : "; +if( $fmt->isLenient() ){ + echo('TRUE'); +}else{ + echo('FALSE'); +} ?> ]]> @@ -84,7 +113,8 @@ TODO &example.outputs; @@ -92,7 +122,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_is_lenient + datefmt_create + diff --git a/reference/intl/dateformatter/set-pattern.xml b/reference/intl/dateformatter/set-pattern.xml index 41d0d760de..b8e75ba2c1 100644 --- a/reference/intl/dateformatter/set-pattern.xml +++ b/reference/intl/dateformatter/set-pattern.xml @@ -1,5 +1,5 @@ - + DateFormatter::setPattern @@ -52,7 +52,9 @@ &reftitle.returnvalues; - 'true' if successful, 'false' if an error occured. Bad formatstrings are usually the cause of the latter. + &return.success; + Bad formatstrings are usually the cause of the failure. + @@ -61,8 +63,14 @@ <function>datefmt_set_pattern</function> example ]]> @@ -71,8 +79,14 @@ TODO OO example getPattern(); +echo "First Formatted output is ".datefmt_format( $fmt , 0); +$fmt->setPattern('yyyymmdd hh:mm:ss z'); +echo "Now pattern of the formatter is : ".$fmt->getPattern(); +echo "Second Formatted output is ".datefmt_format( $fmt , 0); + ?> ]]> @@ -80,7 +94,10 @@ TODO &example.outputs; @@ -88,7 +105,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_pattern + datefmt_create + diff --git a/reference/intl/dateformatter/set-timezone-id.xml b/reference/intl/dateformatter/set-timezone-id.xml index 77854b344c..43f882f29d 100644 --- a/reference/intl/dateformatter/set-timezone-id.xml +++ b/reference/intl/dateformatter/set-timezone-id.xml @@ -1,10 +1,10 @@ - + DateFormatter::setTimeZoneId datefmt_set_timezone_id - sets the time zone to use + Sets the time zone to use &reftitle.description; @@ -23,9 +23,8 @@ stringzone - sets the time zone to use -if null or the empty string, the default time zone for -the runtime is used. + Sets the time zone to use. + @@ -36,14 +35,16 @@ the runtime is used. fmt - The formatter resource + The formatter resource. zone - zone ID string of the time zone to use. + The time zone ID string of the time zone to use. + If &null; or the empty string, the default time zone for the runtime is used. + @@ -54,7 +55,8 @@ the runtime is used. &reftitle.returnvalues; - 'true' on successful setting of the time zone, 'false'if an error occurred (such as the time zone wasn't recognized). + &return.success; + @@ -63,8 +65,11 @@ the runtime is used. <function>datefmt_set_timezone_id</function> example ]]> @@ -73,8 +78,12 @@ TODO OO example getTimezoneId(); +$fmt->setTimezoneId('CN'); +echo "Now timezone_id of the formatter is : ".$fmt->getTimezoneId(); + ?> ]]> @@ -82,7 +91,8 @@ TODO &example.outputs; @@ -90,7 +100,10 @@ TODO &reftitle.seealso; -TODO + + datefmt_get_timezone_id + datefmt_create +