I've run into a strange problem that's at the cause of a bigger issue down the road. I'll define the initial problem (that's not really a problem) followed by the issue caused by it.
I have a javascript function that defines a date variable and sends it as data in a post request to a php function:
var currentdate = new Date();
var showDailyEvents = function() {
$.post(
'/php/returnEvents.php',
{
myDate: currentdate,
period: "daily"
},
"html"
);
};
showDailyEvents();
When I run this on a Mac (across all browsers), currentdate is "Fri Mar 17 2017 15:37:29 GMT-0700 (PDT)". However when I run it on a PC (Windows 7 specifically), currentdate is "Fri Mar 17 2017 15:37:29 GMT-0700 (Pacific Daylight Time)". When this variable is passed into the php function, I try to convert it to a timestamp like so:
$startDay = strtotime($_POST['myDate']);
But when I check that variable, in Mac it is 1489790249 while on PC it is returned as false. The only difference between the variables on the two computers is the PDT vs Pacific Daylight Time.
Has anyone encountered this issue? Or have any idea how to solve this appropriately?
EDIT: Please note, I need the 'Fri' part of the date