I have the following php code that is meant to format the current date and time:
$rawdatetime = time();
$datetime = date('Y-m-d', $rawdatetime) . 'T' . date('H:i:s', $rawdatetime) . '.000Z';
$this->debug($datetime);
The formatting seems to be working fine, but it keeps outputting that it is 1970; I get the following output:
1970-01-01T00:00:00.000Z
My guess is that my server is not configured properly, but my Google search has not given me any clues. I am running WAMP if it helps.
Thanks in advance for any advice you may have.
EDIT: it seems that the date and time functions are working properly; but assigning them to a variable is what is the problem. Any work arounds to get the same formatting as above would be welcomed. But I would also like to know why this problem is happening.