How to set indonesia time zone in php?

by filiberto , in category: PHP General , 9 months ago

How to set indonesia time zone in php?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by edmond_brakus , 9 months ago

@filiberto 

You can set the time zone for Indonesia in PHP by using the date_default_timezone_set() function. Here is an example of how to set the time zone to Indonesia (Jakarta):

1
date_default_timezone_set('Asia/Jakarta');


You can add this line of code at the beginning of your PHP script to set the time zone for Indonesia. This will ensure that all date and time functions in your script will use the specified time zone.