0

I want to set date and time based on users location.

I used the following php code to set the date and time in indian standard time.

how to find the users timezone.

<?php
    $timezone = "Asia/Kolkata";
    date_default_timezone_set($timezone);
    $time=date("h:i a");
    $date = date("M d,Y");
?>

thanks in advance.

Syed mohamed aladeen
  • 6,507
  • 4
  • 32
  • 59

1 Answers1

2

You need to get the timezone from a JavaScript code, and then transmit it to your server.

Examples can be found here: get user timezone

Community
  • 1
  • 1
guhur
  • 2,500
  • 1
  • 23
  • 33