How can I get seconds 开发者_如何学JAVAfrom 1970 in Java?
You mean epoch time? You can use
long epoch = (System.currentTimeMillis()/1000L);
that will get the number of seconds since January 1st 1970 UTC time.
this belongs on StackOverflow though, it will be moved there shortly so please don't repost.
java.lang.System.currentTimeMillis()
gives you the time since Jan 1, 1970 in milliseconds. Just divide by 1000 to get the time in seconds.
精彩评论