category | Zend |
---|---|
package | Zend_Locale |
subpackage | Format |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
checkDateFormat(string $date, array $options = array()
) : boolean
If no format is given, the default date format from the locale is used If you want to check if the date is a proper date you should use Zend_Date::isDate()
string
Date string
array
Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
boolean
convertNumerals(string $input, string $from, string $to = null
) : string
Examples for conversion from Arabic to Latin numerals: convertNumerals('١١٠ Tests', 'Arab'); -> returns '100 Tests' Example for conversion from Latin to Arabic numerals: convertNumerals('100 Tests', 'Latn', 'Arab'); -> returns '١١٠ Tests'
string
String to convert
string
Script to parse, see {@link Zend_Locale::getScriptList()} for details.
string
OPTIONAL Script to convert to
\Zend_Locale_Exception |
---|
string
Returns the converted inputconvertPhpToIsoFormat(string $format) : string
.. use 'en' as locale if you are in need of the original english names
The conversion has the following restrictions: 'a', 'A' - Meridiem is not explicit upper/lowercase, you have to upper/lowercase the translated value yourself
string
Format string in PHP's date format
string
Format string in ISO formatgetDate(string $date, array $options = array()
) : array
The 'format' option allows specification of self-defined date formats, when not using the default format for the 'locale'.
string
Date string
array
Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
array
Possible array members: day, month, year, hour, minute, second, fixed, formatgetDateFormat(string|\Zend_Locale $locale = null
) : string
string
\Zend_Locale
OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
\Zend_Locale_Exception |
throws an exception when locale data is broken |
---|
string
formatgetDateTime(string $datetime, array $options = array()
) : array
string
DateTime string
array
Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
array
Possible array members: day, month, year, hour, minute, second, fixed, formatgetDateTimeFormat(string|\Zend_Locale $locale = null
) : string
string
\Zend_Locale
OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
\Zend_Locale_Exception |
---|
string
formatgetFloat(string $input, array $options = array()
) : float
string
Number to localize
array
Options: locale, precision. See {@link setOptions()} for details.
float
getInteger(string $input, array $options = array()
) : integer
Examples for input: ' 2345.4356,1234' = 23455456 '+23,3452.123' = 233452 ' 12343 ' = 12343 '-9456km' = -9456 '0' = 0 '(-){0,1}(\d+(.){0,1})*(\,){0,1})\d+'
string
Input string to parse for numbers
array
Options: locale. See {@link setOptions()} for details.
integer
Returns the extracted numbergetNumber(string $input, array $options = array()
) : string
Examples for input: '2345.4356,1234' = 23455456.1234 '+23,3452.123' = 233452.123 '12343 ' = 12343 '-9456' = -9456 '0' = 0
string
Input string to parse for numbers
array
Options: locale, precision. See {@link setOptions()} for details.
\Zend_Locale_Exception |
---|
string
Returns the extracted numbergetTime(string $time, array $options = array()
) : array
string
Time string
array
Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
array
Possible array members: day, month, year, hour, minute, second, fixed, formatgetTimeFormat(string|\Zend_Locale $locale = null
) : string
string
\Zend_Locale
OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
\Zend_Locale_Exception |
---|
string
formatisFloat(string $value, array $options = array()
) : boolean
string
Localized number string
array
Options: locale. See {@link setOptions()} for details.
boolean
Returns true if a number was foundisInteger(string $value, array $options = array()
) : boolean
string
Localized number string
array
Options: locale. See {@link setOptions()} for details.
boolean
Returns true if a integer was foundisNumber(string $input, array $options = array()
) : boolean
string
Localized number string
array
Options: locale. See {@link setOptions()} for details.
boolean
Returns true if a number was foundsetOptions(array $options = array()
) : array
The 'locale' option helps when parsing numbers and dates using separators and month names. The date format 'format_type' option selects between CLDR/ISO date format specifier tokens and PHP's date() tokens. The 'fix_date' option enables or disables heuristics that attempt to correct invalid dates. The 'number_format' option can be used to specify a default number format string The 'date_format' option can be used to specify a default date format string, but beware of using getDate(), checkDateFormat() and getTime() after using setOptions() with a 'format'. To use these four methods with the default date format for a locale, use array('date_format' => null, 'locale' => $locale) for their options.
array
Array of options, keyed by option name: format_type = 'iso' | 'php', fix_date = true | false, locale = Zend_Locale | locale string, precision = whole number between -1 and 30
\Zend_Locale_Exception |
---|
array
if no option was giventoFloat(string $value, array $options = array()
) : string
string
Number to normalize
array
Options: locale, precision. See {@link setOptions()} for details.
string
Locale formatted numbertoInteger(string $value, array $options = array()
) : string
string
Number to normalize
array
Options: locale. See {@link setOptions()} for details.
string
Locale formatted numbertoNumber(string $value, array $options = array()
) : string
The seperation and fraction sign is used from the set locale.
string
Localized number string
array
Options: number_format, locale, precision. See {@link setOptions()} for details.
\Zend_Locale_Exception |
---|
string
locale formatted number_getEncoding() : string
string
_getUniCodeSupport() : boolean
boolean
_replaceMonth(string $number, array $monthlist) : integer | false
string
Date string (modified)
array
List of month names
integer
false
Position of replaced string (false if nothing replaced)_setEncoding(string $encoding) : void
string
_checkOptions(array $options = array()
) : array
array
Array of options, keyed by option name: format_type = 'iso' | 'php', fix_date = true | false, locale = Zend_Locale | locale string, precision = whole number between -1 and 30
\Zend_Locale_Exception |
---|
array
if no option was given_getRegexForType(string $type, array $options) : string
string
array
Options: locale. See {@link setOptions()} for details.
\Zend_Locale_Exception |
---|
string
_parseDate(string $date, array $options) : array
string
Date string to parse
array
Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
\Zend_Locale_Exception |
---|
array
Possible array members: day, month, year, hour, minute, second, fixed, format_seperateFormat(string $format, string $value, integer $precision) : string
string
string
integer
string
STANDARD = 'auto'