Java tutorial
//package com.java2s; //License from project: Open Source License import java.util.concurrent.TimeUnit; public class Main { private static final int SIXTY_SECONDS = 60; public static int getSeconds(long milliseconds) { return (int) TimeUnit.MILLISECONDS.toSeconds(milliseconds) % SIXTY_SECONDS; } }