ehsan ehsan - 4 months ago 6x
jQuery Question

How can I get timeStamp in my code

I want when page loaded get timeStamp but I can't.

This is my code :

<!DOCTYPE html>
<p id = "x">time</p>
<script src="jquery/jquery1.12.js"></script>


You can use Date object to do this work. now() method return timestamp in miliseconds. Of course javascript return timestamp with client time.

    var timeStamp = Math.floor( / 1000);
<script src=""></script>