Welcome Guest, Not a member yet? Register   Sign In
Class 'Locale' not found
#11

Perhaps then you do not need to use the Time class to format the date. Instead, you can use the standard PHP functions of date and time.

PHP Code:
public function getUpdateAt(string $format 'Y-m-d H:i:s')
{
    
$tm strtotime($this->attributes['created_at']);
    
// some operation with $tm
    
return date($format$tm);

Reply
#12

(05-26-2020, 07:09 PM)vitnibel Wrote: Perhaps then you do not need to use the Time class to format the date. Instead, you can use the standard PHP functions of date and time.

PHP Code:
public function getUpdateAt(string $format 'Y-m-d H:i:s')
{
    
$tm strtotime($this->attributes['created_at']);
    
// some operation with $tm
    
return date($format$tm);


Still I got (Class 'Locale' not found), even I didn't use anything related to date I got same error, for example like this:
PHP Code:
public function getUpdatedAt()
    {
        $this->attributes['updated_at'] = '123'
        return $this->attributes['updated_at'];
    
Reply
#13
Sad 

As it turned out, any call to the magic __get () method of the Entity class associated with dates leads to a call to the mutateDate() function, which in turn leads to a call to the Locale class. Therefore, without installing the Intl extension can not do.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB