Closed
Description
I set arabic language in app config file for defualtLocale like this:
public $defaultLocale = 'ar';
Now, I work with humanize
time function like this:
$time = CodeIgniter\I18n\Time::parse($date, 'America/Chicago');
return $time->humanize();
Now in action I get this error:
DateTime::__construct(): Failed to parse time string (٢٠٢١-٠٥-١٩ ٠١:٤٧:٢٨) at position 0 (�): Unexpected character
SYSTEMPATH\I18n\Time.php at line 1150
public function humanize()
1149 {
1150 $now = IntlCalendar::fromDateTime(Time::now($this->timezone)->toDateTimeString());
I think the DateTime
function have problem with arabic number. because when I set en
for default locale, humanize function
work truly.