How to Get Time in Indian Time Zone?

For You tube API we are setting start Schedule time and End time In

"2015-08-28T00:00:00.000Z" 

This format the Z- is representing the zulu (GMT-7) time zone. I need to pass the time with Indian time zone code (GMT+5:30).

What's the code I need to put for Indian timezone representation?

3

7 Answers

Just set the default time zone to your Local time zone

<?php
date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
echo date('d-m-Y H:i:s');
?>

for PHP, timezone is

'Asia/Kolkata'

you can set the timezone by date_default_timezone_set('Asia/Kolkata');

check PHP: Asia Manual for other timezones in Asia.

Just set the default time zone to your Local time zone

<?php
date_default_timezone_set("Asia/Kolkata");   //India time (GMT+5:30)
echo date('d-m-Y H:i:s');
?>
[PHP]
;
; php.ini file changes
;
; This works too
;date.timezone = Asia/Calcutta
;
date.timezone = Asia/Kolkata
1

Just set the default time zone to your Local time zone

<?php
date_default_timezone_set("Asia/Kolkata");   //India time (GMT+5:30)
echo date('d-m-Y H:i:s');
?>

For India You Can Use : 'Asia/Kolkata',

Here is list of supported time zone in Asia Asia List of All Time zones All Time Zones

Set

date.timezone=Asia/Kolkata

In php.ini file in PHP directory.

Link for Asian timezones.

0
<?php
date_default_timezone_set('Asia/Kolkata');
echo date('d-m-Y h:i:s a');
?>

it will return following output : 02-12-2021 06:02:41 pm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest