According to this: Get current date/time in seconds
var seconds = new Date().getTime() / 1000; gives you the time in seconds. But the time given is a decimal number. How can I turn it into whole number?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You do
Math.round(new Date().getTime() / 1000)or a short (and faster version):Using this binary operator will zero the floating number part of your number (and therefore round it down).