ehsan ehsan - 1 year ago 112
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>

Answer Source

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>

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download