0

I am trying to get the time of the user and have been experimenting with timestamp but found it to display inaccurate time unless I set the timezone to that particular state but this method seems tedious for setting all the states in the world.. I have seen some website where they allow the user to select their GMT timezone.... how is this done in php?

1 Answers1

0
var now = new Date();

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

The JavaScript Date object supports a number of UTC (universal) methods, as well as local time methods. UTC, also known as Greenwich Mean Time (GMT), refers to the time as set by the World Time Standard. The local time is the time known to the computer where JavaScript is executed. Invoking JavaScript Date as a function (i.e., without the new operator) will return a string representing the current date and time.

TsV
  • 629
  • 4
  • 7