|
|
@@ -125,9 +125,7 @@ trait DateFormatTrait
|
|
|
* $time->i18nFormat(Time::UNIX_TIMESTAMP_FORMAT); // outputs '1398031800'
|
|
|
* ```
|
|
|
*
|
|
|
- * If you wish to control the default format to be used for this method, you can alter
|
|
|
- * the value of the static `Time::$defaultLocale` variable and set it to one of the
|
|
|
- * possible formats accepted by this function.
|
|
|
+ * You can control the default format used through `Time::setToStringFormat()`.
|
|
|
*
|
|
|
* You can read about the available IntlDateFormatter constants at
|
|
|
* https://secure.php.net/manual/en/class.intldateformatter.php
|
|
|
@@ -147,9 +145,8 @@ trait DateFormatTrait
|
|
|
* $time->i18nFormat(\IntlDateFormatter::FULL, 'Europe/Berlin', 'de-DE');
|
|
|
* ```
|
|
|
*
|
|
|
- * You can control the default locale to be used by setting the static variable
|
|
|
- * `Time::$defaultLocale` to a valid locale string. If empty, the default will be
|
|
|
- * taken from the `intl.default_locale` ini config.
|
|
|
+ * You can control the default locale used through `Time::setDefaultLocale()`.
|
|
|
+ * If empty, the default will be taken from the `intl.default_locale` ini config.
|
|
|
*
|
|
|
* @param string|int|null $format Format string.
|
|
|
* @param string|\DateTimeZone|null $timezone Timezone string or DateTimeZone object
|
|
|
@@ -261,6 +258,14 @@ trait DateFormatTrait
|
|
|
/**
|
|
|
* Sets the default format used when type converting instances of this type to string
|
|
|
*
|
|
|
+ * The format should be either the formatting constants from IntlDateFormatter as
|
|
|
+ * described in (https://secure.php.net/manual/en/class.intldateformatter.php) or a pattern
|
|
|
+ * as specified in (http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details)
|
|
|
+ *
|
|
|
+ * It is possible to provide an array of 2 constants. In this case, the first position
|
|
|
+ * will be used for formatting the date part of the object and the second position
|
|
|
+ * will be used to format the time part.
|
|
|
+ *
|
|
|
* @param string|array|int $format Format.
|
|
|
* @return void
|
|
|
*/
|
|
|
@@ -272,6 +277,15 @@ trait DateFormatTrait
|
|
|
/**
|
|
|
* Sets the default format used when converting this object to json
|
|
|
*
|
|
|
+ * The format should be either the formatting constants from IntlDateFormatter as
|
|
|
+ * described in (https://secure.php.net/manual/en/class.intldateformatter.php) or a pattern
|
|
|
+ * as specified in (http://www.icu-project.org/apiref/icu4c/classSimpleDateFormat.html#details)
|
|
|
+ *
|
|
|
+ * It is possible to provide an array of 2 constants. In this case, the first position
|
|
|
+ * will be used for formatting the date part of the object and the second position
|
|
|
+ * will be used to format the time part.
|
|
|
+ *
|
|
|
+ * @see \Cake\I18n\Time::i18nFormat()
|
|
|
* @param string|array|int $format Format.
|
|
|
* @return void
|
|
|
*/
|