0

Hello I have created a timer which will be stopped at 4:20 PM or 4:20 AM but the main problem is that if user's log in like users is being the website from California the time is different and if the users is viewing the website the timezone will be different I believe if I am able to get the time from the system this will help me alot

<?php
            $localtime = localtime();


            if($localtime[2] == '16' || $localtime[2] == 04) {
                echo "Timer stopped "
            } else {
                echo "timer is running current time is " . date('H:i:s');
            }
            ?>

The main scenario what I am trying to do is that it will go off at 4:20am and pm both. FRom 4:20-4:29 and the logo will be changed. All other times, it will be default logo.

The timer should automatically adjust to the visitor's timezone. For example, when it is 4:20 in New York, it is 1:20 in California, so the timer should know what time the visitor is from. make sense please help me out with this

Mark Alan
  • 435
  • 1
  • 5
  • 19

0 Answers0