Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get time in Indian Time zone?

Tags:

timezone

php

time

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?

like image 626
Kichu Avatar asked Nov 28 '22 07:11

Kichu


1 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');
?>
like image 134
ColinDave Avatar answered Dec 05 '22 23:12

ColinDave