I am trying to create a variable that gets the current date and time so I can compare it to a deadline (ex: 7/30/12 23:23:10). I put this code in a file called date.php and it is supposed to return a 10 digit number, but instead I get a server error. Can anyone help me create a variable that gets the current time in php?
<?php
$date = date_create();
echo date_timestamp_get($date);
?>
You shouldn’t need such complicated functions.
See the PHP
datedocumentation for more on date formatting.