Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

281
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda