1

I was looking for a method of getting timestamp in jquery, like we do it in php by time() (which is seconds since Jan 1 1970).

I tried event.timeStamp, but it output 9 digits starting with 9, which I know is incorrect.

2 Answers 2

8

Use jquery.now() http://jsbin.com/icesab/edit#javascript,html

Sign up to request clarification or add additional context in comments.

Comments

3

Try this:

Math.floor(+new Date() / 1000)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.