Get Local time| Get International Time in Javascript | Get Local time in php | Get Time according to timezone in php | Get Time According to local timezone
Local Time/ International Time.
Headache!
The solution:-
Use unix timestamp for converting time to local of international timezone for different places.
Just save your time as unix timestamp.
From Your Browser: with javascript
const unixtime= new Date().getTime();
Save this timestamp for database.
While printing on frontend just pass it into the Date class:
const localTime= new Date(unixtime);
From php script:
$unixTime=time().'000';
Comments
Post a Comment