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...
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?
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
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
<?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