Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

280
Visualizações
incorrect time returned in laravel

This is a strange problem

I am using date functions to get time too but it returns wrong time

return date('Y-m-d H:i:s');

This returns 2017-4-21 09:41:44 but the current time is 14:41:44 There is something wrong with hours. I tried NOW() in MySQL and it gave me correct timing but laravel PHP did not. Can someone help?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

In laravel project go to project/config there is a file app.php, in this file search for:

'timezone' => '';

pass your timezone value in it like:

'timezone' => 'Asia/Kolkata', // I am using this for India

And try again, now you will get the correct time as per your timezone.

Note: After passing the timezone value run the command php artisan config:cache to clear the cache so that you get the updated data.

Timezone list reference

about 4 years ago · Santiago Trujillo Relatório

0

You can set your timezone in the Laravel config files. The default value is UTC.

Make sure this is set to your correct timezone.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda