This is PHP can you manage to get the user’s current time zone (and thus their current time)? You might have to grab/con

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

This is PHP can you manage to get the user’s current time zone (and thus their current time)? You might have to grab/con

Post by answerhappygod »

This is PHP
can you manage to get the user’s current time zone (and thustheir current time)? You might have to grab/convert that the otherway around – but if you do, add that information after the “Youhave logged on” line – stating their current time zone (and ifdifferent from server time zone, which I doubt) – their currenttime.
I want to manage to get the user's current time zone. Itshould placed after "You have logged on" line. Which codeshould I have to add?
<?php //Obtain Session Information session_start(); //This is the specials file define('TITLE', 'Our Menu'); //Include the header.html template include('templates/header.html'); ?><?php //Set timezone date_default_timezone_set('America/Toronto'); print '<p><b>Hello, ' .$_SESSION['email'] . '!</b></p>'; print '<p>You have logged at: <b>' .date('g:i a', $_SESSION['loggedin']) .'</b></p>';?> <p>Choose from our outstanding menubelow!</p> <table> <tr><td> <h3>Alternative Meat Pizza - $14.99</h3> <ul> <b>Toppingsincluded:</b> <li>Elk</li> <li>Alligator</li> <li>Snake</li> <li>Boar Bacon</li> </ul> </td><td> <imgsrc="images/alternative_pizza.png" alt="" /> </td></tr> <tr><td> <h3>Fruitarian Pizza - $24.99</h3> <ul> <b>Toppingsincluded:</b> <li>Bananas</li> <li>Kiwi</li> <li>Blueberries</li> <li>Strawberries</li> </ul> </td><td> <imgsrc="images/fruit_pizza.png" alt="" /> </td></tr> </table><?php //Logout link print '<p><ahref="logout.php">Logout</a></p>'; //Include the footer.html template include('templates/footer.html');?>
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply