8

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?

Dharman
  • 30,962
  • 25
  • 85
  • 135
Kichu
  • 1,641
  • 4
  • 21
  • 28

7 Answers7

20

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');
?>
ColinDave
  • 490
  • 1
  • 6
  • 16
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.

Kuldeep
  • 489
  • 6
  • 10
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');
?>
Sani Kamal
  • 1,208
  • 16
  • 26
2

Set

date.timezone=Asia/Kolkata

In php.ini file in PHP directory.

Link for Asian timezones.

Alberto
  • 674
  • 13
  • 25
2
[PHP]
;
; php.ini file changes
;
; This works too
;date.timezone = Asia/Calcutta
;
date.timezone = Asia/Kolkata
Venkat Kotra
  • 10,413
  • 3
  • 49
  • 53
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

Hedayat H
  • 329
  • 1
  • 7
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