AlphalogicZ

  • Home
  • Services
  • Work
  • Blogs
  • Contact
  • Home
  • Posts tagged "Laravel"
June 18, 2025

Tag: Laravel

How to set Timezone in Laravel

Thursday, 19 August 2021 by AlphalogicZ

An easy way to set a timezone for a user in your application and then show date/times to them in their local timezone.

You can set your app time zone by configuring app.php file in config folder.

  1. Open the file app.php located in config directory in your project. Check for Application Timezone where default time zone will be set as,

Here you can add your time zone as below,

This is the time zone for paris

'timezone' => 'Europe/Paris',

This is the time zone for India

'timezone' => 'Asia/Kolkata',

After changing app.php, make sure you run below command,

php artisan config:clear

How to change time zone in .env file

Here you can add your timezone like.

'timezone' => env('APP_TIMEZONE', 'UTC'),
APP_TIMEZONE='Europe/Paris'
CodingLaravelPHPPHP ProgrammingProgramming Language
Read more
  • Published in PHP Programming
No Comments

Categories

  • Apache
  • PHP Programming
  • Server
  • Ubuntu

Recent Posts

  • How To Set Up Password Authentication with Apache on Ubuntu 14.04

    When setting up a web server, there are often s...
  • Apache, non-WWW to WWW (HTTPS/Secure)

    Here is my “normal” config file and just “gets ...
  • How to set Timezone in Laravel

    Open the file app.php file present in config di...
  • Write Clean and Secure PHP Code

    I’m reading Clean Code, a technical book which ...

Archives

  • October 2021
  • September 2021
  • August 2021
  • September 2020

Pages

  • Blogs
  • Contact
  • home
  • Services
  • test-blog
  • Work
TOP