Mark Kennedy Mark Kennedy - 1 year ago 217
PHP Question

PHP equivalent of JavaScript getTime()

Suppose I'm running the following JavaScript getTime() function

<script language="JavaScript">
var $x = Math.round((new Date()).getTime()/1000);
</script>


What would the equivalent code in PHP look like?

Answer Source

Unix time in php

$time_stamp = time();
echo $time_stamp;