Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahmadshobirin/5e761c055b4bae2b13262ce9d58be2cb to your computer and use it in GitHub Desktop.
Save ahmadshobirin/5e761c055b4bae2b13262ce9d58be2cb to your computer and use it in GitHub Desktop.
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' => 'id']);
	Carbon::setLocale('id');
}

Open file config/app.php

Change separated values

'timezone' => 'Asia/Jakarta',

'locale' => 'id',

'faker_locale' => 'id_ID',

Display the date with Indonesian language

Try this step in views or controller also step is recommended here


Carbon\Carbon::parse('2019-03-01')->translatedFormat('d F Y');

@NaufalParamaRafif
Copy link

Thanks! bang..

@AlanPratama
Copy link

thank you for the information, i'm going to use it very often. I'm appreciate!

@pr-bw
Copy link

pr-bw commented May 19, 2024

Untuk Laravel 11 bisa langsung diatur lewat .env

@aspsptyd
Copy link

izin porek masse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment