IntlDateFormatter::getErrorMessage
En esta página
IntlDateFormatter::getErrorMessage
datefmt_get_error_message
Lee el último mensaje de error
Descripción#
Estilo orientado a objetos
public IntlDateFormatter::getErrorMessage(): string
```php
Estilo procedimental
```php
datefmt_get_error_message(IntlDateFormatter $formatter): string
Lee el mensaje de error de la última operación.
Parámetros#
formatter
El recurso de formateador IntlDateFormatter.
Valores devueltos#
La descripción del último error.
Ejemplos#
Ejemplo con datefmt_get_error_message
<?php
$fmt = datefmt_create(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = datefmt_format($fmt);
printf(
"Error : %s (%d)\n",
datefmt_get_error_message($fmt),
datefmt_get_error_code($fmt)
);
?>
Ejemplo orientado a objetos
<?php
$fmt = new IntlDateFormatter(
'en_US',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'America/Los_Angeles',
IntlDateFormatter::GREGORIAN
);
$str = $fmt->format(0);
printf(
"Error : %s (%d)\n",
$fmt->getErrorMessage(),
$fmt->getErrorCode()
);
?>
El ejemplo anterior mostrará:
Error : U_ZERO_ERROR (0)
Véase también#
datefmt_get_error_code, intl_get_error_code, intl_is_failure