Code:
date_default_timezone_set('America/Los_Angeles');
$textDate = strtotime($date);
var_dump($textDate);
var_dump($date);
The output:
int 1352012400
string '11/04/12' (length=8)
The issue is that when you convert the actual timestamp out, it’s 1AM EST.
I’m generating this timestamp having set the timezone to PST — what is going on? What am I doing wrong? I can obviously just add two hours, but I really shouldn’t have to! This can’t be a result of timestamp issues with my server or PC, either, because this is happening in abeyance of current time — I’m converting a date from a specific format to the UNIX timestamp for midnight in the morning, that date.
The actual issue appears to have revolved around the use of DST — because the date in question was at the end of DST, time calculations became skewed by about one hour. How that turned what should have been 3AM EST into 1AM EST I’m not sure (perhaps the website I used to do the quickie conversion was off), but it also explains why all my math was coming out wrong no matter how many times I checked it.