I just don't understand GMT on how it works with your php sql server time. How do you relate to your database with the minutes offset? So if this produces -420 minutes how do we relate that to our database time (for example unix time 2016-09-14 22:40:31)(your NOW() time)?
I am just not sure how to implement this in PHP? There is some vague information I have found on how to use it after you get your minutes offset.
`date_default_timezone_set('America/Boise');`
$created=date('Y-m-d H:i:s');
I got the code below from:
https://stackoverflow.com/a/5492192/6173198
function TimezoneDetect(){
var dtDate = new Date('1/1/' + (new Date()).getUTCFullYear());
var intOffset = 10000; //set initial offset high so it is adjusted on the first attempt
var intMonth;
var intHoursUtc;
var intHours;
var intDaysMultiplyBy;
//go through each month to find the lowest offset to account for DST
for (intMonth=0;intMonth < 12;intMonth++){
//go to the next month
dtDate.setUTCMonth(dtDate.getUTCMonth() + 1);
//To ignore daylight saving time look for the lowest offset.
//Since, during DST, the clock moves forward, it'll be a bigger number.
if (intOffset > (dtDate.getTimezoneOffset() * (-1))){
intOffset = (dtDate.getTimezoneOffset() * (-1));
}
}
return intOffset;
}
alert(TimezoneDetect());