9

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 7

21

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');
?>
13

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.

7

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');
?>
2

Set

date.timezone=Asia/Kolkata

In php.ini file in PHP directory.

Link for Asian timezones.

0
2
[PHP]
;
; php.ini file changes
;
; This works too
;date.timezone = Asia/Calcutta
;
date.timezone = Asia/Kolkata
1
  • date.timezone = "Asia/Kolkata" Best Solution, Thanks Apr 19, 2020 at 16:59
2

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

2
<?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 and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.