I feel like an idiot and I'm probably missing something obvious. I created a function which, for simplicity I've reduced to:
function displayDate(){
echo date("M j, Y g:ia", $startDate);
}
I also have the following code:
echo date("M j, Y g:ia", $startDate);
These are both outputting different things. The first one is Dec 31, 1969 5:00pm, the second one is Nov 8, 2017 7:30pm.
Why is this happening? They're getting their information from the same place. These 2 pieces of code are right next to each other.
EDIT: for more info, I'm using Processwire CMS and the $startDate is being taken from a datetime field type.