@@ 251-259 (lines=9) @@ | ||
248 | * @param string $locale The locale in which we want the date |
|
249 | * @return string The formatted date according to current locale settings |
|
250 | */ |
|
251 | public function formatSimpleDate($value = 0, $timezone = '', $type = \IntlDateFormatter::MEDIUM, $locale = '') |
|
252 | { |
|
253 | if (empty($value)) { |
|
254 | $value = time(); |
|
255 | } |
|
256 | ||
257 | $dateObject = $this->_getDateObject($type, \IntlDateFormatter::NONE, $timezone); |
|
258 | return $dateObject->format($value); |
|
259 | } |
|
260 | ||
261 | /** |
|
262 | * Returns a formatted medium-typed time |
|
@@ 272-280 (lines=9) @@ | ||
269 | * @param string $locale The locale in which we want the time |
|
270 | * @return string The formatted time according to current locale settings |
|
271 | */ |
|
272 | public function formatSimpleTime($value = 0, $timezone = '', $type = \intlDateFormatter::MEDIUM) |
|
273 | { |
|
274 | if (empty($value)) { |
|
275 | $value = time(); |
|
276 | } |
|
277 | ||
278 | $dateObject = $this->_getDateObject(\intlDateFormatter::NONE, $type, $timezone); |
|
279 | return $dateObject->format($value); |
|
280 | } |
|
281 | ||
282 | /** |
|
283 | * Gets the possible timezone candidates and if only found one, instantiates a DateTimeZone object |