I need to get current date & time and convert it to 11 digit unix timestamp.
Just like this site does:
http://www.onlineconversion.com/unix_time.htm
I googled a lot but all i could find was timestamp to date conversion problems & answers.
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.
does what you want. Original answer here.
System.currentTimeMillis() returns the time from the Unix epoch in milliseconds. As
1 second = 1000 milliseconds, you simply divide it by 1000 to get the time in seconds.