Breaking News

javascript – Change timezone in my phpmyadmin shared server

Questions:

I need to change my timezone to India timezone, but my shared server database showing some junk timezone I tried all the possibility but I can’t get the India time zone.

I am using PHP Codeigniter

I Have a contact us page on my website, which saves all the send inquiry details to my mail and database. on that is showing some junk time on it

please help me out of this issue

How to&Answers:

In the case of shared hosting you would need to contact support guys or go for a live chat and they can change the default time zone for you.

You can use date_default_timezone_set() which sets a default timezone.

Please give a look here

OR

convert all your times to UTC on server side and just work with UTC instead

EDITED ANSWER

What you can do is :

Store your date time in DB in UTC, and while showing You can show Date time By getting current timezone of India.

// create a $dt object with the UTC timezone
$dt = new DateTime('2016-12-12 12:12:12', new DateTimeZone('UTC'));

// change the timezone of the object without changing it's time
$dt->setTimezone(new DateTimeZone('Asia/Kolkata'));

// format the datetime
$dt->format('Y-m-d H:i:s T');

About rankhawks

Check Also

AWS Certified Developer – Associate 2019

AWS Certified Developer – Associate 2019 Do you want AWS certification? Do you want to …

Learn PHP Symfony 4 Hands-On Creating Real World Application

Master Symfony 4, Create a real world application step by step up to deploying it! What Will …

Code With Ruby – Ruby Programming

A comprehensive coding with the Ruby Programming, starting from scratch and moving to advanced coding …

Build A Complete Registration And Login System Using PHP MVC

Add registration, login, remember me, account activation, password reset by email and more using the …

Master All PHP Ideas – To Build Any Project

Master All PHP Ideas – To Build Any Project Learn all practical ideas used in …

Leave a Reply

Your email address will not be published. Required fields are marked *